#!/bin/bash
for i in {1..100}
do
{
ping -c1 -W2 10.8.161.$i &> /dev/null
if [ $? -eq 0 ]
then
echo "10.8.161.$i" >> /root/ping.txt
else
echo "10.8.161.$i --不存在"
fi
} &
done
wait
echo "测试完毕"
#!/bin/bash
for i in {1..100}
do
{
ping -c1 -W2 10.8.161.$i &> /dev/null
if [ $? -eq 0 ]
then
echo "10.8.161.$i" >> /root/ping.txt
else
echo "10.8.161.$i --不存在"
fi
} &
done
wait
echo "测试完毕"