while read line do ip=`echo $line | awk '{print $2}' ` ping -c 1 -i 0.2 -W 3 $ip if [ $? -ne 0 ];then echo $line | tee -a b fi done < $1