[adding bug-bash]
On 08/29/2010 08:48 AM, Ralf Wildenhues wrote:
With Solaris 10 sh (and others):
cat<<EOF
${var-"quo ted"}
EOF
"quo ted"
Whereas with bash (and others):
quo ted
Ouch. New one to me. ksh, zsh, and dash do not echo the quotes, so I'm
thinking it may be a bash bug; hence the cc.
Eric, did you have this in your recent autoconf.texi additions already?
It can be a problem for all of the stuff that gets expanded into here
documents.
Now, for the good news - the bug is easy to work around, while still
using a here-doc. A here-doc is parsed in a different context (no word
splitting, no filename expansion) than normal, so /bin/sh does NOT have
the bug related to "bad parameter" messages if you omit the quotes.
All shells that I had access to reliably gave the same output for:
cat <<EOF
${var-quo ted}
EOF
quo ted
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org