检测ip是否在线(并发执行)

#!/bin/bash
for ip in 218.60.28.{1..255}
do
        (ping $ip -c2 &> /dev/null && echo -e "在线: $ip" || echo "***离线: $ip***")&
done
wait

猜你喜欢

转载自blog.csdn.net/wangshui898/article/details/80509721