Thread: cat << EOF
View Single Post

   
  #6 (permalink)  
Old 02-20-2008, 08:08 AM
Eef Hartman
 
Posts: n/a
Default Re: cat << EOF

ray <nospam@example.com> wrote:
> The question is - is that the shell (bash) or ??? that supports that
> function?


It is actually a generic shell function, any self-respecting shell
should support it (and that includes bash, tcsh, ksh and even the
original Bourne shell:
<<[-]word The shell input is read up to a line that is the
same as word, or to an end-of-file. The resulting
document becomes the standard input. If any
character of word is quoted, no interpretation is
placed upon the characters of the document;
otherwise, parameter and command substitution
occurs, (unescaped) \new-line is ignored, and \
must be used to quote the characters \, $, `, and
the first character of word. If - is appended to
<<, all leading tabs are stripped from word and
from the document.
from the man page for the Bourne shell on a HP-UX - real Unix SystemV -
workstation).

As people already told you, it's called a "here document", as it was
invented to put the input for a command INTO the script itself (the
input document is "here").
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Reply With Quote