bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Despite text in gnu bash manual, quote removal appears to be perform


From: Stahlman Family
Subject: Re: Despite text in gnu bash manual, quote removal appears to be performed on case pattern
Date: Sun, 10 Dec 2006 22:18:25 -0600


----- Original Message ----- From: "Eric Blake" <ebb9@byu.net>
To: "Stahlman Family" <brettstahlman@comcast.net>
Cc: <bug-bash@gnu.org>
Sent: Sunday, December 10, 2006 3:40 PM
Subject: Re: Despite text in gnu bash manual, quote removal appears to be 
performed on case pattern


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Stahlman Family on 12/10/2006 8:11 AM:
Mingw (Msys) Bash 2.04.0(1)-release

Consider upgrading.  Bash is now at 3.2, with a number of bugs fixed in
the meantime.

I'd like to, but I think the Msys maintainers perform some mingw-specific tweaks on the cygwin sources before building, and the Msys distribution is still at 2.04. I have a newer Cygwin version installed (3.00) but rarely use it anymore because the version control and build toolchain we use at work uses an older version of the cygwin1.dll, which means I get the infamous shared memory error if I try to run them both simultaneously.


$ case $dbg in
" foo bar ") echo "1" ;;
\ foo\ bar\ ) echo "2" ;;
esac
1

It appears you have found a bug in the POSIX specification.  POSIX states:
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_04

"In order from the beginning to the end of the case statement, each
pattern that labels a compound-list shall be subjected to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion, and
the result of these expansions shall be compared against the expansion of
word"

but mentions quote removal for the word immediately after for.  But
traditional behavior has always performed quote removal on the patterns,
and changing bash would break many existing scripts.

Understood. I actually prefer the existing behavior, since there are certainly times when you would wish to disable the glob special meanings of characters in a pattern. Also, it makes sense that case patterns should be processed the same as are pathname expansion patterns.

Thanks,
   Brett S.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFfH7q84KuGfSFAYARAoRsAJ4lCGpncu/8BWPbJHR98scdYRHc9wCguJpb
yI5sOsI+iGQJD0XEXpPUSBw=
=St9Q
-----END PGP SIGNATURE-----






reply via email to

[Prev in Thread] Current Thread [Next in Thread]