Quick Rescue Heart Pill Read

Source: Internet
Author: User
Tags echo command

In the recent process of processing data with the shell, it was found that the read command would replace \ t with a space when reading the data, and \ t discard at the end of the line. Look at the help of Read, find-R can retain the escape character, searched for someone also said can use-r, but my experimental results are even if-R is still still. Unfortunately, data processing with awk should be used. Using \ t as the data field delimiter is often used during data mining, and the default key and value separators for map reduce are also \ t, so use the shell's read command to be aware of the point.

Similarly, the echo command by default does not recognize the escape character, such as echo "123\t123", he will directly print out the 123\t123, if you want to recognize, you need to use ECHO-E string; Considering its command, I usually use printf when outputting important data;

Quick Rescue Heart Pill Read

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.