Bill Nottingham <notting@redhat.com> wrote:
> Chet Ramey (chet@nike.ins.cwru.edu) said:
>> Are you wedded to using here documents? Remember that here-docs
>> are expanded as if the contents occur within double quotes, but
>> that double quotes within the document aren't treated specially.
>
> For this app, yes, it would be irritating to not be able to use here-docs
> (the alternative is writing temporary files and piping those through
> commands.)
But is it necessary to do the complex expansion inside the here
document?
FOO=bar
FOO_here=${FOO:+\"$FOO\"}
cat <<EOF
${FOO_here}
EOF
paul