cat <<EOF> file

.多行导入文件(新建文件或者覆盖文件内容)
 
cat << EOF > abcd.txt
Hello!
This is a test file!
Test for cat and EOF!
EOF
 
来看下执行结果
 
cat abcd.txt
Hello!
This is a test file!
Test for cat and EOF!
这就是多行导入!
 
用法2.文件追加
cat << EOF >> test.sh
 
3:说明
其实可以用其他字符来代替EOF,它也只是个标识符而已!
posted on 2014-12-09 17:17  寒星12345678999  阅读(214)  评论(0编辑  收藏  举报