1.在shell中嵌入类似help的文档
平时我们都是将help的内容全部用echo命令输出 ,写起来有点烦,下面可以使用shell的嵌入文档的方式来完成help的输出
function usage()
{
cat << EOF
--help display the help information
-p use the service name
EOF
}
语法为
command >> 标识符
。。。。。
标识符
2.可以用来操作数据库
mysql -u root <<EOF
use mysql
select * from user
EOF
3.可以用来使用expect
expect - c >> EOF
spawn ssh root@192.168.20.110
.....
EOF