-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Greg Schafer on 2/21/2006 8:20 PM: > > status=`echo '-'| { ${GREP} -E -e 'a\' >/dev/null 2>&1 ; echo $?; }`
Even shorter - from the command line: bash-3.1.9 $ echo `echo 'a\'` a\ bash-3.1.10 $ echo `echo 'a\'` > # Oops, bash is still looking for input > [Ctrl-c] bash-3.1.10 $ echo `echo 'a\\'` # Some hint as to what went wrong a\ > > AFAICT, this used to be accepted by older Bash versions. > > Do think problem lies with this Bash patch or with test case? The bug is in official patch 10. POSIX parsing rules (http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html) state in step 5 of 2.3 token recognition that on the first `, the shell parses until the end of the command substitution, and in 2.6.3 command substitution, that when parsing a command substitution the backslash retains its literal meaning except when followed by $, `, or \. In this case, it is followed by ', so the nested command should be "echo 'a\'". However, patch 10 only affected backticks: bash-3.1.10 $ echo $(echo 'a\') a\ So as a workaround, the test can be rewritten: status=$(echo '-'| { ${GREP} -E -e 'a\' >/dev/null 2>&1 ; echo $?; }) - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD/bVV84KuGfSFAYARAiEbAKCeC83Ke7kXKa61wgYt4JUn6hYSEwCdF9iu wck5gmcvRR8d6u285MLP6To= =GK+O -----END PGP SIGNATURE----- _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash