I have a text file (file.txt) with these entries:
SERVER1
SERVER2
I do this in script.ksh
cat file.txt|while read server
do
rsh $server –l myuser ls
done
the loop break after the first rsh without error
if instead I do this:
cat file.txt|while read server
do
echo rsh $server –l myuser ls
done
The two lines are treated
It works with a "for" loop too
for server in `cat file.txt`
do
rsh $server –l myuser ls
done
what's wrong with rsh command in a while loop?
Thanks in advance
SERVER1
SERVER2
I do this in script.ksh
cat file.txt|while read server
do
rsh $server –l myuser ls
done
the loop break after the first rsh without error
if instead I do this:
cat file.txt|while read server
do
echo rsh $server –l myuser ls
done
The two lines are treated
It works with a "for" loop too
for server in `cat file.txt`
do
rsh $server –l myuser ls
done
what's wrong with rsh command in a while loop?
Thanks in advance