ping text file @linux

#!/bin/bash
# Program name: pingall.sh
date
cat site.txt |  while read output
do
    ping -w 1 -i 0.5 -c 1 "$output" | awk '{print $2$3}' >> ip.txt
#    if [ $? -eq 0 ]; then
#    echo "node $output is up" 
#    else
#    echo "node $output is down"
#    fi
done

發佈留言