shell 脚本远程执行命令
#!/bin/sh ip=`cat allip` for i in $ip;do ping -c 1 $i if [ $? -eq 0 ];then num=`ssh $i "find /data/ -name py-env.tar.gz" |wc -l` if [ $num -ne 0 ];then echo $i >> yes.txt fi fi done
#!/bin/sh ip=`cat allip` for i in $ip;do ping -c 1 $i if [ $? -eq 0 ];then num=`ssh $i "find /data/ -name py-env.tar.gz" |wc -l` if [ $num -ne 0 ];then echo $i >> yes.txt fi fi done