通讯测试脚本

脚本内容如下:

#!/bin/sh
while (true)
do
 for i in `cat hostip.txt`
  do
  ping -c 4 -i 0.2 $i | grep -q 'ttl=' && echo "$i ok" || echo "$i failed"
 done
 echo "--------------------------------------------"
done
exit
hostip.txt内容如下:
192.168.2.100
192.168.2.101
192.168.2.102
192.168.2.103
192.168.2.104
192.168.2.105
192.168.2.106

你可能感兴趣的:(linux)