From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9249 invoked from network); 29 Apr 2009 16:36:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Apr 2009 16:36:49 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 48322 invoked from network); 29 Apr 2009 16:36:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Apr 2009 16:36:45 -0000 Received: (qmail 9068 invoked by alias); 29 Apr 2009 16:36:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26902 Received: (qmail 9059 invoked from network); 29 Apr 2009 16:36:39 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Apr 2009 16:36:39 -0000 Received: from vms173003pub.verizon.net (vms173003pub.verizon.net [206.46.173.3]) by bifrost.dotsrc.org (Postfix) with ESMTP id 1FB8E80EA0C0 for ; Wed, 29 Apr 2009 18:34:19 +0200 (CEST) Received: from torch.brasslantern.com ([96.249.201.13]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KIV009AIFFVWW9E@vms173003.mailsrvcs.net> for zsh-workers@sunsite.dk; Wed, 29 Apr 2009 11:36:00 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id n3TGZsrM009856 for ; Wed, 29 Apr 2009 09:35:55 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n3TGZsrP009855 for zsh-workers@sunsite.dk; Wed, 29 Apr 2009 09:35:54 -0700 From: Bart Schaefer Message-id: <090429093553.ZM9854@torch.brasslantern.com> Date: Wed, 29 Apr 2009 09:35:53 -0700 In-reply-to: <200904290851.n3T8p3m8013327@news01.csr.com> Comments: In reply to Peter Stephenson "Re: PATCH: improve ${(q)...}" (Apr 29, 9:51am) References: <5191.1240937187@csr.com> <090428153749.ZM8596@torch.brasslantern.com> <200904290851.n3T8p3m8013327@news01.csr.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: improve ${(q)...} MIME-version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.92.1/9305/Wed Apr 29 15:43:01 2009 on bifrost X-Virus-Status: Clean On Apr 29, 9:51am, Peter Stephenson wrote: } } > The proposed patch changes the behavior of nested (q) options rather } > significantly. E.g., ${(qqq)${(qq)v}} becomes very different. This } > could be important if the resulting string is going to be processed } > with "eval". } } I don't follow that. The quotation is present if the inner quotation } would cause the word to behave differently when unquoted. Stripping } multiple levels of quotation should therefore still work. Or are you } thinking of things like the example below? I'm not necessarily thinking of any specific example. With the current code, ${(qqq)${(qq)v}} produces "'foo'" which still has single quotes after one level of quotes is stripped. If that's combined with another string that also contains single quotes, whether by directly adjacent concatenation or by interpolation inside a double-quoted string, etc., those quotes might mean something. } I won't rely on my expectation here---it's different with backslash } quoting anyway. However, you've certainly spotted a case I hadn't where } this changes the behaviour. I can look for different letters... } Hmm, we could use qQ which is currently meaningless as a sort of } shorthand for "minimal quoting"...? What does (qqQQ) mean, then? Or (qQq)? It'd probably be better to pick something that currently isn't even valid syntax, like (q-) ... I was all set to suggest (q1) (q2) etc. but (q0) already means "split at NULL bytes and then quote". However, (q-) raises the question of what (-q) means, and whether (-) by itself means anything; the only character that is currently "attached" to a preceding flag is ":" and (q:EXPR:) seems like overkill.