Here document usage (cat <EOF) in linux shell what is Here too enthere Document is a special redirection method in Linux Shell, its basic form is as follows cmd <delimiter Here Document Contentdelimiter. Its function is to pass the Content between two delimiter (Here Document Content) to cmd as the input parameter. For example, if you enter cat <EOF in the terminal, the system will prompt you to continue the input, enter multiple lines of information and then enter EOF. The information entered in the middle will be displayed on the screen. Fish @ mangos :~ $ Cat <EOF> First Line> Second Line> Third Line EOF> EOFFirst LineSecond LineThird Line EOF Note:> this symbol is the identifier of the prompt input information generated by the terminal. The EOF is only an identifier. It can be replaced with any valid character as the end of delimiter, there cannot be any character before the end of delimiter, nor any character (including space) before and after the start of delimiter will be omitted Here Document can be used not only on the terminal, it can also be used in shell files, such as the following here. sh file cat <EOF> output. shecho "hello" echo "world" EOF sh here. sh. sh, which contains the following echo "El Lo "echo" world "Here Document deformation delimiter and variables in the content of Here Document can not only include common characters, but also use variables in it, such as the preceding here. sh to cat <EOF> output. shecho "This is output" echo $ 1EOF sh here. sh HereDocument run the script to get the output. sh Content echo "This is output" echo HereDocument here $1 is expanded as the script parameter HereDocument, but sometimes I don't want to expand This variable. What should I do, you can add "before and after the starting delimiter, for example, add the preceding here. sh to cat <"EOF"> output. sh # note the out produced by echo "hello" echo "world" EOF. The put. sh content is echo "This is output" echo $1 <changed to <-Here Document. Another usage is to change '<' to '<-'. The only change using <-is that the tab (tab) at the front of each line in the content section of the Here Document will be deleted, this method is used to indent the Content Part Of The Here Document for easy reading of the Code.