当前位置: > shell编程 >

cat EOF 使用一例

时间:2014-09-10 22:38来源:linux.it.net.cn 作者:it

cat EOF 使用一例,用下面方法很简单的按格式写入文本:
 

复制代码代码如下:

#!/bin/sh

cat <<EOF >>/etc/hosts
Please Write your message want to attach here.
# This is just a test.

127.0.0.1 localhost
EOF

#-----------
echo 'test' >> /etc/hosts

sed...

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容