ssh ls *|wc -l 返回统计值

来源:互联网 发布:深圳市软件培训机构 编辑:程序博客网 时间:2024/05/22 14:07

ssh ls *|wc -l 返回统计值

#!/bin/sh

 for i in {2..25}
 do
        ip=10.161.21.$i
        echo $ip

        t=`ssh unicomlabs@$ip    "ls /home/unicomlabs/qq*|wc -l"`;
        echo "t=$t"
       #echo $ip >> ip10.161.21.txt;  echo "####################################################" >> ip10.161.21.txt;echo "####################################################" >> ip10.161.21.txt
        #t2=`ssh unicomlabs@$ip   cat /home/unicomlabs/ip2.txt|wc -l`;
        #t3=`ssh unicomlabs@$ip   cat /home/unicomlabs/ip3.txt|wc -l`;
        #t4=`ssh unicomlabs@$ip   cat /home/unicomlabs/ip4.txt|wc -l`;
        #t5=`ssh unicomlabs@$ip   cat /home/unicomlabs/ip5.txt|wc -l`;
        #t=$(($t1+$t2+$t3+$t4+$t5))
        #echo "$ip=$t";


done

0 0
原创粉丝点击