Heredocs

I haven't found a heredoc solution for this one yet:

You have a file containing a list of package names. You want to pass that list to a program as a series of parameters.

  1. a=cat(filename)
  2. aptitude install $a

Writing text to a variable
$ a=$(cat <<EOT
now
is
the
time
EOT
)
$ echo $a
now is the time
$ echo "$a"
now
is
the
time


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site and MAY contain peanuts.
Many thanks to Debra Lynn and Ian Murdock for making Debian possible
First created Apr 22, 2008 ~ Last revised October 13, 2009

Valid XHTML 1.0 Strict Valid CSS!