From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24962 invoked by alias); 14 May 2015 23:51:37 -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: 35143 Received: (qmail 25091 invoked from network); 14 May 2015 23:51:35 -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: <55553501.3050904@case.edu> Date: Thu, 14 May 2015 19:51:29 -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> <20150514165557.59f6bdc9@pwslap01u.europe.root.pri> In-Reply-To: <20150514165557.59f6bdc9@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 11:55 AM, Peter Stephenson wrote: > It occurs to me that other shells will treat whitespace as ending a > pattern for syntactic reasons, even if logically it can't: > > [[ ' ' = [ ] ]] > > works in zsh, but is a parse error in bash. Because shell metacharacters delimit words. The definition of a WORD (and the use of WORDs as patterns) doesn't really change depending on whether you're parsing a case command or a conditional command. > (*) Relegated to a footnote because this is more of a rant than > a useful comment: furthermore, the whole []] thing is designed > so that you *don't* need to quote characters in the [...]. So > do you, or don't you? Bleugh. You do. Conditional commands use the same definition of WORD tokens as everything else. -- ``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/