Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of EOF Custom Terminator in Linux

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report