vim shell.sh
十库百表
for n in {1..10} do if [ $n != 10 ] then n=0"${n}" fi for i in {00..99} do mysql -h host${n} -P port -uusername -ppwd -D database -e 'SQL' >> logname done done