标签:ping测试
#!/bin/bash
#edit by www.jbxue.com
for a in {1..254}
do
if ping -w 1 -c 1 152.55.249.$a | grep "100%" >/dev/null
then
echo "152.55.249.$a is Not reachable"
else
echo "152.55.249.$a is reachable"
fi
done
解释:-w表示时间一秒,-c表示ping1次,如果返回100%,则表示失败输入到then语句,否则输入到else语句。
本文出自 “嘟嘟的成长日记” 博客,请务必保留此出处http://3402313.blog.51cto.com/3392313/1652737
标签:ping测试
原文地址:http://3402313.blog.51cto.com/3392313/1652737