home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: mengel@dcdmwm.fnal.gov (Marc W. Mengel)
-
- davidf@mks.com ("David J. Fiander") writes:
- >This seems to be attempting to ensure that a script like this
- > foo=`sed 1q`
- > hi there
- > echo $foo
- > echo Done
- >When fed to the shell on standard input will generate the output
- > hi there
- > Done
-
- This only works well on tty-style devices, where reads return
- on end-of line boundaries. It is also why the shell has
- here-documents, so you can say
-
- foo=`sed 1q <<EOF
- hi there
- EOF`
- echo $foo
- echo Done
-
- to to the job right in a script, pipeline, etc.
-
- -------
- Marc Mengel
- mengel@fnal.fnal.gov
-
-
- Volume-Number: Volume 28, Number 98
-
-