#Shell脚本ping一个网段的IP通不通
#!/bin/bash
for i in {1…20}
do
ip=20.15.0.
ping -c 1
i
p
ip
ipi
if [$? -eq 0];then
echo “YES”
else
echo “NO”
fi
done