From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14206 invoked by alias); 15 May 2015 00:00:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35144 Received: (qmail 12131 invoked from network); 15 May 2015 00:00:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <555536FF.5040505@case.edu> Date: Thu, 14 May 2015 19:59:59 -0400 From: Chet Ramey Reply-To: chet.ramey@case.edu Organization: ITS, Case Western Reserve University User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Peter Stephenson , Martijn Dekker , zsh-workers@zsh.org CC: chet.ramey@case.edu Subject: Re: 'case' pattern matching bug with bracket expressions References: <55549FB2.80705@inlv.org> <20150514154238.0e547ff0@pwslap01u.europe.root.pri> <5554C3A5.4030205@inlv.org> <20150514171716.69cd99c9@pwslap01u.europe.root.pri> In-Reply-To: <20150514171716.69cd99c9@pwslap01u.europe.root.pri> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Junkmail-Whitelist: YES (by domain whitelist at mpv1.tis.cwru.edu) On 5/14/15 12:17 PM, Peter Stephenson wrote: > I don't *think* the following patch makes anything worse, but notice > you're in any case on fairly soggy ground here, even in bash: > > $ var= > $ [[ ']' = [$var]*[$var] ]] && echo matches > matches > > and presumably Chet would agree with me that's required by the > standard. Yes, everybody matches `]' with that pattern. Posix requires that the `case' equivalent match (`[[' is not in the standard), since it specifies the expansions that take place on the pattern before you attempt matching using the pattern matching rules. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/