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

telnet to other servers whose names in a file 1

Status
Not open for further replies.

we2aresame

Technical User
Feb 10, 2003
128
CA
I tried to write a script to telnet to other servers, all servers' name in a file, can anybody help me to figure out how to read the server name from the file and give it to telnet, thanks.
 
while read host
do
telnet "${host}"
done < hostFile.txt

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
To select a host from a list...

select ID in $(<hostFile.txt)
do
[ $ID ] && telnet $ID
break
done

...you should see your hosts and a prompt, use 0 to abort.



 
Ygor,
have never used 'select' myself, but it is VERY helpful!

thanks for the tip.


vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top