查询网段可用ip脚本
#!/bin/bash
rm -rf /log/ip.txt
for inum in `seq 1 253`
do
Un=`ping -c 2 10.0.1.$inum | grep loss | awk -F[:" "]+ '{print $6}'`
if [ $Un = '100%' ];then
echo 10.0.1.$inum >> /log/ip.txt
fi
done
本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/1868664如需转载请自行联系原作者
yangzhimingg