Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping Script Help

Status
Not open for further replies.

unable24

Technical User
Nov 15, 2001
13
US
Can somebody help me w/ my ping script: It works until it hits a bad IP - then locks up and doesn't write to my bad file - I just want a script that pings a list of IP's (ie clt.txt) and creates a list of failed devices...

#!/bin/sh
while read HOST
do
ping $HOST -n 2 > /users/bastir/tempfile.txt
if grep ! /users/bastir/tempfile.txt
then
echo "cannot ping $HOST successfully" >> /users/bastir/pingbad.txt
else
echo "can ping $HOST successfully" >> /users/bastir/pinggood.txt
fi
done < /users/bastir/clt.txt
 
Tried man fping - don't seem to have it?????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top