for n in `mysql -uroot -p‘12334‘ -e "use novel;show tables;"|sed ‘1d‘`;do echo $n; mysql -uroot -p‘12334‘ -e "use novel;select count(*) from $n;";done >test.txt
[root@git-server ~]# cat test11.txt
fpagent
count(*)
1
fpagentprop
count(*)
0
fpagentsession
count(*)
0
fpchatsetting
count(*)
51
fpdispatcher
count(*)
1
fpdispatcherprop
count(*)
0
fpofflinesetting
count(*)
0
fpqueue
count(*)
1
fpqueueagent
count(*)
1
fpqueuegroup
count(*)
0
原文地址:http://blog.51cto.com/wujianwei/2119979