Introduction of EOF Custom Terminator in Linux
EOF custom Terminator usage
We often find the use of EOF in scripts. EOF can append the content in combination with the cat command. For example, when you execute a script, you need to automatically enter multiple lines into a file. If it's a few lines, you can append it with the echo command, but if it's a lot of lines, it's not appropriate to append it with echo alone.
1. Syntax format: >: output redirect, append, do not overwrite the previous content this is eof > eof > content > eof end > EOF[ root @ VM_0_10_centos shellScript] # cat eof.txt this is eofeofcontenteof endeof or [root@VM_0_10_centos shellScript] # cat > eof.txt qwer > qaz > EOF
Input content to the file, do not overwrite, enter as an append
[root@VM_0_10_centos shellScript] # cat > eof.txt > 12345 > 56789 > EOF [root @ VM_0_10_centos shellScript] # cat eof.txt this is eofeofcontenteof endeof1234556789 or [root@VM_0_10_centos shellScript] # cat > > eof.txt wsx > edc > EOF [root @ VM_0_10_centos shellScript] # cat eof.txt qwerqazwsxedc
Original address: https://www.linuxprobe.com/linux-eof-diy.html