1、指定的环境 >> EOF 查询语句 EOF
eg:统计表条数
#!/bin/sh
count='mysql -uroot -p123456 <<EOF
select count(1) from ANAN;
EOF'
echo ${count}
2、EOF配合cat 来进行追加
eg:#!/bin/bash
cd /home/mcmon/UserCutting
cat >> /home/bba/UserCutting/test1.txt << EOF
hello heilongj
nihao
EOF