home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.28 / text0096.txt < prev    next >
Encoding:
Text File  |  1992-08-17  |  635 b   |  32 lines

  1. Submitted-by: mengel@dcdmwm.fnal.gov (Marc W. Mengel)
  2.  
  3. davidf@mks.com ("David J. Fiander") writes:
  4. >This seems to be attempting to ensure that a script like this
  5. >    foo=`sed 1q`
  6. >    hi there
  7. >    echo $foo
  8. >    echo Done
  9. >When fed to the shell on standard input will generate the output
  10. >    hi there
  11. >    Done
  12.  
  13. This only works well on tty-style devices, where reads return
  14. on end-of line boundaries.  It is also why the shell has
  15. here-documents, so you can say
  16.  
  17.     foo=`sed 1q <<EOF
  18.     hi there
  19.     EOF`
  20.     echo $foo
  21.     echo Done
  22.  
  23. to to the job right in a script, pipeline, etc.
  24.  
  25. -------
  26. Marc Mengel
  27. mengel@fnal.fnal.gov
  28.  
  29.  
  30. Volume-Number: Volume 28, Number 98
  31.  
  32.