Re: Strange shell script behaviour
- From: Robert Lawhead <news0000.5.unixguru@xxxxxxxxxxxxxxx>
- Date: Wed, 21 Jun 2006 09:20:21 -0700
Richard Wright wrote:
Hi,If you must use rsh, "rsh -n" to keep remote process from consuming
I've posted this up on the Sun forums but no joy, so what do you make
of this;
I'm having problems with rsh inside a shell script.
Look at the following script;
cat /etc/hosts | while read LINE
do
echo reading $LINE
done
This works fine - each line is echoed out to the screen.
Now if I add in a rsh;
cat /etc/hosts | while read LINE
do
echo reading $LINE
rsh `hostname` ls
done
It only processes the first line and then quits the loop, although the
rsh line works fine.
Can anyone explain why and/or give me a workaround?
I need to read a line at a time as I process each line through awk in
my real script.
Note that the rsh doesn't really do much, it just rsh's to itself and
executes an ls (which outputs to the screen no probs).
Also, /etc/hosts is just there as an example. Any file has the same
result.
ta..
the remaining input from stdin.
.
- References:
- Strange shell script behaviour
- From: Richard Wright
- Strange shell script behaviour
- Prev by Date: Strange shell script behaviour
- Next by Date: Re: Increase the size of an active filesystem that is nearing its max Solaris 8
- Previous by thread: Strange shell script behaviour
- Next by thread: Re: Strange shell script behaviour
- Index(es):
Relevant Pages
|