Shell scripting Tips (1)-How to resolve a multiline redirect Terminator in a script without snapping to the beginning of the line

Source: Internet
Author: User
1. What is the problem requirement?

First, the need to come from, mainly to write shell script, with cat for multi-line input redirection, the Terminator must be hyphenation first, the format is not good-looking.

2, how? How to solve this problem?

First Baidu, Google search the next, the result is to say that more is the shell multi-line redirection does not solve the actual problem, may be the search for the wrong keyword. Artificial Intelligence search found a good article, others write better than me, we browse by themselves: [1190000008130200]
Mostly with <<-.

3, why? What's the principle?

In fact, a change of mind, this is which function, is the function of bash, so go to man bash a bit, and then/<< to search under the multi-line redirection can find first off interpretation, such as input and output, multi-line redirection, and other related help.

So, a different way of thinking, for other orders is not also used in this way, in the Niang and evil under the Google can not quickly retrieve useful information in a manner. And the search is not necessarily official ^_^

Shell scripting Tips (1)-How to resolve a multiline redirect Terminator in a script without snapping to the beginning of the line

Related Article

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.