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