for((i=15;i<=174;i++));do if [ -d "$i" ] then cd $i echo 当前产品sn==$i ls -ltr *pdf | grep -v tmp | wc -l cd .. fi done mysql -uroot -p'xxxxxx' -e "select * from (select productSn from zjzc.ClientInvestOrder order by sn) a group by productSn" | while read A do echo 当前产品sn==$A mysql -uroot -p'xxxxxxxx' -e "select count(a.clientSn) from zjzc.ClientPersonalInfo a ,zjzc.ClientInvestOrder b where a.clientSn=b.clientSn and b.productSn='$A';" done