command << label
input line 1
input line n
This allows you to redirect input to a shell script from within the shell script itself.
- << label indicates that label marks the end of the here document
- label must appear on a line by itself to end the here document
- << 'label' prevents the shell from doing parameter and command substitution in the here document
- <<- label deletes leading tabs (but not spaces) from the here document
Here Document Example
(from page 189 in "Learning the Korn Shell")
for user in $(ypcat passwd | cut -f1 -d:)
mail $user <<- EOF
A new version of $pgmname has been installed
in $(whence $pgmname).
Your friendly sysadmin