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: Eric Blake
Subject: Re: Despite text in gnu bash manual, quote removal appears to be performed on case pattern
Date: Sun, 10 Dec 2006 14:40:58 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666

-----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.

> 
> $ 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.

- --
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]