假设有如下脚本check_alive.sh

#!/bin/sh
for ip in `seq $2 $3`
do
(
ping $1.$ip -c2 &>  /dev/null
if [ $? -eq 0 ];
then
    echo $1.$ip is alive
else
    echo $1.$ip is down
fi
)&
done

wait