Introducing UNIX and Linux |
Getting startedOverview |
Here-documentsYou will sometimes wish to give input to a command, where that
input consists of a small number of lines - for example, if you
want to create a script which, after it executes its commands,
mails One possibility would be to create a file for the message
( mailx sam <mymessage
as the last line of the script. This would work, but would
involve creating two files (one for your script, and one for the
message) rather than just one. In large scripts it might become
confusing if too many files have to be created. Note that this
would not be a problem if A solution is known as a here-document.
Following the symbol
The line that terminates the input need not be |
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck