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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple script with input file 1

Status
Not open for further replies.

mkapsak

MIS
Aug 5, 2004
9
US
Hi,

I have a file called allclientindexes. This file contains a list of servers that I want to ping to see if they are alive. I want to save the results into another file. Can someone show me what the script should look like? Running on HP-UX 11.23.

Thanks...
 
This assumes that allclientindexes has only one server name per line:

Code:
#!/bin/ksh

while read line
do
  ping "$line" >> outputfile.txt
done < allclientindexes
 
Thanks olded, but it only pings the first entry in the allclientindexes file only.
 
Check that your allclientindexes file is unix-friendly, and change it with dos2unix if not.

The internet - allowing those who don't know what they're talking about to have their say.
 
I had some help from internal staff and got it working. Thanks for the replies!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top