home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!crdgw1!rdsunx.crd.ge.com!ariel!davidsen
- From: davidsen@ariel.crd.GE.COM (william E Davidsen)
- Newsgroups: comp.unix.shell
- Subject: Re: rsh terminates while loop
- Message-ID: <1992Dec16.163349.16919@crd.ge.com>
- Date: 16 Dec 92 16:33:49 GMT
- References: <1992Dec14.202147.5077@crd.ge.com> <1992Dec15.054605.6780@cs.wisc.edu>
- Sender: usenet@crd.ge.com (Required for NNTP)
- Reply-To: davidsen@crd.ge.com (bill davidsen)
- Organization: GE Corporate R&D Center, Schenectady NY
- Lines: 30
- Nntp-Posting-Host: ariel.crd.ge.com
-
- In article <1992Dec15.054605.6780@cs.wisc.edu>, dws@ssec.wisc.edu (DaviD W. Sanderson) writes:
-
- | Redirect the rsh input from /dev/null:
- |
- | #!/bin/sh
- | while read host flags
- | do result=`rsh $host uname $flags < /dev/null`
- | echo "$host: $result"
- | done
-
- I told several people who mailed me suggestions to redirect the input
- that I had tried it before posting. However, it seems that what I tried
- was:
- result=`rsh $host uname $flags` < /dev/null
- rather than
- result=`rsh $host uname $flags < /dev/null`
- which works.
-
- This is somewhat non-intuitive, and seems to contradict what the man
- pages say, although I couldn't find anywhere in which the context of the
- `expression` was clearly stated as being (or not being) effected by
- redirection.
-
- Thanks to the people who mailed solutions to me, it's clear that
- redirection within the quotes will protably work, even if it's not as
- clear that redirection outside the quotes doesn't.
-
- --
- bill davidsen, GE Corp. R&D Center; Box 8; Schenectady NY 12345
- Keyboard controller has been disabled, press F1 to continue.
-