From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8722 invoked by alias); 15 May 2015 00:10:45 -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: 35145 Received: (qmail 10727 invoked from network); 15 May 2015 00:10:44 -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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <55553940.6080103@case.edu> Date: Thu, 14 May 2015 20:09:36 -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> <5554D65B.8070500@inlv.org> <20150514184332.3803584d@pwslap01u.europe.root.pri> In-Reply-To: <20150514184332.3803584d@pwslap01u.europe.root.pri> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Junkmail-Whitelist: YES (by domain whitelist at mpv2.tis.cwru.edu) On 5/14/15 1:43 PM, Peter Stephenson wrote: > This is hairy because you're relying on whitespace performing word > splitting in a case where you don't need whitespace according to the > grammar anyway, i.e. if you have the valid expression > > case abc in (["$empty"]|[!a-z]*) echo yes ;; (*) echo no ;; esac > > it can only be parsed the way zsh parses it --- you'll find bash does > the same. The `|' delimits the token; `["$empty"]' is a single WORD. Both shells effectively parse this the same way. -- ``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/