home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!uwm.edu!daffy!uwvax!ssec.wisc.edu!dws
- From: dws@ssec.wisc.edu (DaviD W. Sanderson)
- Newsgroups: comp.unix.shell
- Subject: Re: rsh terminates while loop
- Message-ID: <1992Dec15.054605.6780@cs.wisc.edu>
- Date: 15 Dec 92 05:46:05 GMT
- References: <1992Dec14.202147.5077@crd.ge.com>
- Sender: news@cs.wisc.edu (The News)
- Organization: UW-Madison Space Science and Engineering Center
- Lines: 21
-
- In article <1992Dec14.202147.5077@crd.ge.com> davidsen@crd.ge.com (bill davidsen) writes:
- >It appears that the rsh does /something/ which wipes out the stdin of
- >the while loop.
-
- Yes. rsh eats its standard input and gives it to the remote command.
- The rsh man page on my system says this:
-
- The rsh command sends standard input from the local command
- line to the remote command
-
- >If anyone has some words of wisdom on this I'd love to hear them,
-
- 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
-
- DaviD W. Sanderson (dws@ssec.wisc.edu)
-