Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!caen!uwm.edu!linac!att!oucsace!sadkins From: sadkins@oucsace.cs.OHIOU.EDU (Scott W. Adkins) Newsgroups: comp.unix.questions Subject: Re: Bourne to read? Keywords: Bourne read Message-ID: <3033@oucsace.cs.OHIOU.EDU> Date: 1 Mar 91 15:04:56 GMT References: <1991Feb28.160948.24987@hoss.unl.edu> Distribution: na Organization: Ohio University CS Dept., Athens Lines: 23 In article <1991Feb28.160948.24987@hoss.unl.edu> mosemann@sardion.unl.edu (Russell Mosemann) writes: > > In the Bourne shell, why does this not work > > echo words | read W > > but this does (if I put the words in the file) > > read W < file Well, it could be a matter of where things are coming from and where they are going to. In the first case, echo words is sending the stuff to stdout, not stdin. The read W is waiting for input from stdin, not stdout. Result? The words will be echoed to the screen and then the script will wait for keyboard input. In the second example, the '<' symbol literally means redirect the output of this file to this other file. In other words, file is redirected to stdin of read W. I hope this helps. If I am wrong on these accounts, I will be watching for the correct solution. Scott Adkins sadkins@oucsace.cs.ohiou.edu