On Mon, Feb 21, 2011 at 9:34 PM, C Anthony Risinger <[email protected]> wrote:
>
> store heredoc in variable (best of both examples, at cost of `cat`
> call and subshell):
>
> opts=$(cat <<EOF
> ...
> EOF)

... and something else just for grins :-) as i didn't think of it
until right after i sent my msg ...

---------------------------------
read -rd $'\0' opts <<EOF
grub=A nice long explantaion about grub :-)
syslinux=And that's why we are teh awesome!
insert_here=I'm just along for the ride
EOF

echo "$opts"
---------------------------------

that will store the entire heredoc into $opts (remember to use quotes
for output of course); since null is used as a delimiter, and bash
variables/strings are not capable of storing null, this guarantees the
entire doc will be in `$opts`.

it really is ridiculous what bash is capable of ... anyways, carry on,
nothing to see here.

C Anthony

Reply via email to