ping命令快速测试IP是否在线
!/bin/bash
ip=10.2.71.
for i in {1..255}
do
{
ping -W 2 -c 1 $sum$i &> /dev/null
if [$? == 0]
then echo $ip$i >>host_ip
fi
}&
done
ip=10.2.71.
for i in {1..255}
do
{
ping -W 2 -c 1 $sum$i &> /dev/null
if [$? == 0]
then echo $ip$i >>host_ip
fi
}&
done
评论已关闭