#!/bin/bash
total=0
for (( i=0; i<101; i=i+1 ))
do
cnt=`/usr/local/mysql/bin/mysql -h127.0.0.1 -uroot -p123456 test -N -e "select count(distinct(uin)) from test$i"`
echo $cnt
total=`expr $total + $cnt`
done
echo total
#!/bin/bash
total=0
for (( i=0; i<101; i=i+1 ))
do
cnt=`/usr/local/mysql/bin/mysql -h127.0.0.1 -uroot -p123456 test -N -e "select count(distinct(uin)) from test$i"`
echo $cnt
total=`expr $total + $cnt`
done
echo total