Get the App
SLTechnology News&Howtos  ›  Servers  › 

Introduction of EOF Custom Terminator in Linux

Shulou Source: shulou.com Published: 2022-06-02 06:19:07 09月22日 Update

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

Tags: Content input file command output method script consistency separator text address internal regular meeting situation time standard format case symbol Terminator Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Huawei macOS Linux MySQL