#!/bin/bash
cd `dirname $0`
data=`
mysql -uXXXX --password=XXX <use dbname;
select * from XXXX;
EOF`
echo $data | awk 'XXXX'
这样就可以将查询的结果赋值给一个变量
#!/bin/bash
cd `dirname $0`
data=`
mysql -uXXXX --password=XXX <use dbname;
select * from XXXX;
EOF`
echo $data | awk 'XXXX'