In Linux, eof is a custom terminator, which is the abbreviation of "END Of File"; because it is a custom terminator, eof is not fixed, and you can set an alias at will. In Linux, press "ctrl d" represents eof. Eof is generally used with the cat command for multi-line text output, which refers to the end of the file.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
EOF is the abbreviation of END Of File, which represents a custom terminator.
Since it is customized, EOF is not fixed and you can set an alias at will.
Pressing ctrl-d in Linux means EOF.
EOF generally cooperates with cat to output multi-line text.
Its usage is as follows:
<<EOF //开始 .... EOF //结束
It can also be customized, such as customization:
<<BBB //开始 .... BBB //结束
Sample
[root@localhost test]# cat << EOF > test.sh > 123456789 > abcdefghj > tdss32323 > EOF [root@localhost test]# cat test.sh 123456789 abcdefghj tdss32323 [root@localhost test]# cat << BBB > test.sh > dddddddddd > aaaaaaaaaa > eeead12133 > BBB [root@localhost test]# cat test.sh dddddddddd aaaaaaaaaa eeead12133 如果想追加 cat << EOF >> test.sh
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is eof in linux. For more information, please follow other related articles on the PHP Chinese website!