bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'while read' loop ends


From: Ralph Corderoy
Subject: Re: 'while read' loop ends
Date: Mon, 09 Aug 2004 13:08:59 GMT

Hi Zsiros,

>         #!/bin/bash
>         while read -r remhost
>         do
>           ssh $remhost "uname -a"
>           echo $remhost
>         done <$1
> 
>        $ ./test.sh test.par
>        Displays only "uname -a" and hostname of host1 in parameterfile.

The ssh's standard input is also reading $1 and it is being connected to
the remote sshd.  See ssh(1)'s -f and -n options, or try `ssh ...
</dev/null'.

In other words, imagine the ssh is really `cat >/dev/null'.

Cheers,


Ralph.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]