linux shell << 注释多行

#!/bin/bash
#script name: a.sh
#author: aaron

<<EOF
echo "line 1"
echo "line 2"
echo "line 3"
EOF

cat <<EOF > a.out
echo "line 4"
    echo "line 5"
echo "line 6"
EOF

cat <<EOF
echo "line 7"
    echo "line 8"
echo "line 9"
EOF

line 1 2 3 注释掉了

line 4 5 6 输出到 a.out

line 7 8 9 输出到屏幕

posted @ 2016-05-26 22:18  aaron_agu  阅读(3373)  评论(0编辑  收藏  举报