Linux Today: Linux News On Internet Time.

More on LinuxToday

Shell Scripts and Here Documents

Jan 26, 2010, 12:04 (0 Talkback[s])
(Other stories by Juliet Kemp)


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

"A here document (or heredoc) is a way of getting text input into a script without having to feed it in from a separate file. If you've got a small quantity of data you don't expect to change often, it's a quick and tidy way of keeping script and data together. For more complicated data or scripts, separating the two is still usually a better idea.

"The basic version of this in bash looks like this:

cat << EOF
several lines of 
my data
listed here

"which will output

several lines of 
my data
listed here

Complete Story

Related Stories: