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

 

posted @ 2020-08-29 13:53  Tse先生  阅读(6050)  评论(0编辑  收藏  举报