处理oracle
a=`sqlplus -s 属主/密码@数据库 <<EOFset heading off feedback offselect 1+100 from dual;
exit;
EOF`
echo ${a} > test.txt
heading off // 回显时不显示前缀
feedback off // 回显不显示xxx rows selected.
处理mysql
a=`mysql -h ip -P 端口 -u 用户名 -p 密码<<EOF${sql}
EOF`
echo ${a} > test.txt