#!/bin/bashbash
ip=192.168.10.ide
for i in `seq 1 20`spa
doorm
ping -c 2 $ip$i > /dev/null 2>&1 | grep -q 'ttl=' && echo "$ip$i is yes " || echo "$ip$i is no "ip
doneit
或者
class
#!/bin/shgrep
for n in `seq 245`
do
ping -c2 192.168.26.$n >/dev/null 2>&1
if [ $? -eq 0 ]
then
im
echo "192.168.26.$n is up" >>/data/uplist.log margin
else
echo "192.168.26.$n is down" >>/data/downlist.log
fi
done