shell echo单行和多行文字定向写入到文件中


单行文本:

#!/bin/bash
echo "192.168.85.24 tsedb">> /etc/hosts

 

多行文本:

<<EOF告诉主shell,后续的输入,是其他命令或者子shell的输入,直到遇到EOF为止

#!/bin/bash
cat > /etc/security/limits.conf<< EOF
#tsedb SETTING
tsedb soft nproc 16384
tsedb hard nproc 16384
tsedb soft nofile 16384
tsedb hard nofile 65536
tsedb soft stack 10240
tsedb hard stack 32768
tsedb hard memlock 8000000
tsedb soft memlock 8000000
EOF

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM