实战-找出192.168.1.1-10网段中,服务器已经关机的IP地址
[root@xuegod63 ~]# vim ping.sh
#!/bin/bash i=1 for (( i=1;i<10;i++ )) do ping -c 3 192.168.1.$i &> /dev/null if [ $? -ne 0 ];then echo 192.168.1.$i is shutdown fi done
[root@xuegod63 ~]# vim ping.sh
#!/bin/bash i=1 for (( i=1;i<10;i++ )) do ping -c 3 192.168.1.$i &> /dev/null if [ $? -ne 0 ];then echo 192.168.1.$i is shutdown fi done