I am trying to read a host name one at a time from a file which has a list of hostnames and do rsh and print . its not looping through the entire file. its breaking out after the first entry. If i comment out the rsh then it loops through file
Are your remote host configured to authorized connection from your machine ?
(is your hostname added properly in the .rhost file in the account of the remote host you are trying to connect to ?)
if you manually give a try of rsh to these hosts, does it work fine ?
There are two attempts to read the file. I see two read -r var in the above output. Can you check if the input file is in correct format. Or maybe some junk character is present.
Also check that the rsh works manually on the second remote host of your list
By the way ... according to the output, your script try to send a mail using mailx as well as you use printf instead of the print and i don't see those line of code in the script you have posted initially ...
So i suppose you didn't post the whole script you run or you did some modifications on it.
If you post only part of your script and that the error is somewhere else we could hardly guess where it could come from ...
So maybe you should post again what you exactly run
@ctsgnb - the rsh works on all the hosts - @116@434 - in fact there is only one read attempt - i think its copy paste error
input file is clean - i can print and iterate through the file if I comment out the rsh commands.
if i do
while read -r var
do
print $var
done<$filename
it just works fine
---------- Post updated at 12:53 PM ---------- Previous update was at 12:27 PM ----------