Eric Blake wrote: > Read the POSIX rationale: > http://www.opengroup.org/onlinepubs/009695399/xrat/xcu_chap02.html
> | [...] While the newer "$()" form can process > | any kind of valid embedded script, the backquoted form cannot handle > | some valid scripts that include backquotes. For example, these > otherwise > | valid embedded scripts do not work in the left column, but do work > on > | the right: > | > | echo ` echo $( > | cat <<\eof cat <<\eof > | a here-doc with ` a here-doc with ) > | eof eof > | ` ) > | > | echo ` echo $( > | echo abc # a comment with ` echo abc # a comment with ) > | ` ) BTW, My bash-3.2.15(1)/libc2.3.6/i686-pc-linux-gnu-2.6.13 (like previous releases) fails on the first $() example. It also fails if the here-doc contains a single, double or back quote instead of the ). "case x in x)" in $() is also not accepted; this is to be worked around with "case x in (x)" (POSIX is stricter, though). Academic failure: an embedded here-doc, with unproblematic content, but ) as delimiter instead of eof. [ksh93 and all almquist shells are robust about all these. zsh and pdksh behave very similar to bash.] [[The second $() example from above was fixed with bash-3.2]] _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash