> I have confirmed that > it still exists in bash-3.1-beta1, but have not yet tested > if bash 3.1 final patchlevel 1 has fixed the bug.
My results: bash 3.1, with or without patch 1, still has the bug. $ k=$(case x in x) echo hi; esac) bash: syntax error near unexpected token `esac' > The rationale page > (http://www.opengroup.org/onlinepubs/009695399/xrat/xcu_chap02.html) > then proceeds to list several examples of $() commands where > an unmatched ')' can appear inside the nested command, when used > as part of a valid shell script. Of which, bash gets 2 of the three examples WRONG: Required: $ echo $( > cat <</eof > a here-doc with ) > eof > ) a here-doc with ) $ echo $( > echo abc # a comment with ) > ) abc $ echo $( > echo ')' > ) ) bash 3.0.16: $ echo $( > cat << /eof > a here-doc with ) a here-doc with $ # oops, the ) in the here-doc was consumed to close the $(), and $ # without a warning of a missing eof delimiter $ echo $( > echo abc # a comment with ) abc $ # oops, the ) in the comment was consumed to close the $() $ echo $( > echo ')' > ) ) $ # The only correct answer of the three bash 3.1.1: $ echo $( > cat << /eof > a here-doc with ) a here-doc with $ # oops, the ) in the here-doc was consumed to close the $(), and $ # without a warning of a missing eof delimiter $ echo $( > echo abc # a comment with ) > ) abc ) $ # oops, an extra ) snuck through to the outer echo $ echo $( > echo ')' > ) ) $ # The only correct answer of the three -- Eric Blake _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash