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
#!/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