From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16354 invoked by alias); 15 May 2015 08:38:59 -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: 35150 Received: (qmail 17718 invoked from network); 15 May 2015 08:38:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f4-f79c56d0000012ee-fb-5555b09e1adb Date: Fri, 15 May 2015 09:38:51 +0100 From: Peter Stephenson To: Peter Stephenson , zsh-workers@zsh.org Subject: Re: 'case' pattern matching bug with bracket expressions Message-id: <20150515093851.57b973bc@pwslap01u.europe.root.pri> In-reply-to: <20150514165557.59f6bdc9@pwslap01u.europe.root.pri> References: <55549FB2.80705@inlv.org> <20150514154238.0e547ff0@pwslap01u.europe.root.pri> <5554C3A5.4030205@inlv.org> <20150514165557.59f6bdc9@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsVy+t/xy7rzNoSGGnRcFbQ42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGc8uzmAqmMlWsXn+bKYGxtcsXYycHBICJhInpj9hgrDFJC7c W8/WxcjFISSwlFFi4pW9zBDODCaJd5v3sUA42xglZv85yw7SwiKgKvHy+nw2EJtNwFBi6qbZ jCC2iICLRNe0L2A1wgKOEr/6O1lBbF4Be4nGd5PA1nEKOEgs/DkfauhaRonPv5aBFfEL6Etc /fsJ6iZ7iZlXzjBCNAtK/Jh8D+xuZgEtic3bmlghbHmJzWveMoPYQgLqEjfu7mafwCg0C0nL LCQts5C0LGBkXsUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kRErhfdjAuPmZ1iFGAg1GJh/fG ytBQIdbEsuLK3EOMEhzMSiK8s9cBhXhTEiurUovy44tKc1KLDzFKc7AoifPO3fU+REggPbEk NTs1tSC1CCbLxMEp1cDIHv+KjTXh71IWkecbyoz2HHIS+uu8/a6sirZ6j2BlJJdm2XUPvomH wo9uyEhPD30frHTgiNc3Tqc1TBsi13kzz3zVo6a9IXD5Jae2ZQIZy8rN3n55+i/276mY0r3Z 5rpdc9lFjiz8V+ouNv8+t/AppT1i7eIzJu7unhijGphramXY4qa+V06JpTgj0VCLuag4EQBF 2iYCWAIAAA== On Thu, 14 May 2015 16:55:57 +0100 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. I'm talking nonsense here --- I'm thinking of parentheses (which have always been subtle because of zsh's pattern syntax and work differently in POSIX mode anyway). A space after a square bracket *does* split the word. Otherwise we wouldn't know whether "[ " at the start of the line was a test command or the start of a group. I don't think changing the case parsing to do proper words is *that* difficult --- it's always been a bit of a hack, so could do with being fixed. pws