linux ping 并发执行

#!/bin/bash
IP="10.0.0."

for i in `seq 2 10`
do
{
    ping=`ping -c 2 -w 2 $IP$i > /dev/null`
    if [ $? -eq 0 ];then
     echo "ping $IP$i is up"
    else
        echo "ping $IP$i is down"
    fi } & 
done

  

  

原文地址:https://www.cnblogs.com/chrishg/p/12113800.html