From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16240 invoked by alias); 15 Feb 2012 12:37:27 -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: 30227 Received: (qmail 24582 invoked from network); 15 Feb 2012 12:37:22 -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 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Wed, 15 Feb 2012 12:36:41 +0000 From: Peter Stephenson To: CC: Subject: Re: Bug with bash emulation regarding ':' Message-ID: <20120215123641.01e5a4fd@pwslap01u.europe.root.pri> In-Reply-To: <4F3AEE8D.9050705@case.edu> References: <20120129183644.6d49d237@pws-pc.ntlworld.com> <120131202909.ZM6076@torch.brasslantern.com> <120201082929.ZM7032@torch.brasslantern.com> <20120205201133.3bcd2b7f@pws-pc.ntlworld.com> <20120214174154.36268595@pwslap01u.europe.root.pri> <4F3AEE8D.9050705@case.edu> Organization: Cambridge Silicon Radio 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-Originating-IP: [10.101.10.170] X-Scanned-By: MailControl 7.6.6 (www.mailcontrol.com) on 10.68.1.135 On Tue, 14 Feb 2012 18:30:21 -0500 Chet Ramey wrote: > Bash doesn't split word in ${parameter:OPword} because Posix says not > to: >.. > The same thing actually happens in both examples; you just look at the > results of the expansion in the second case. The rhs gets expanded, > but not split, assigned to test_split_var, and that becomes the result > of the parameter expansion. Those results get split, since the param > expansion doesn't occur within double quotes, and passed to `:' and echo > as arguments. Thanks, that's along the lines I supposed but more detailed. To get this behaviour in zsh we'd have to do the assignment earlier than we currently do. The assignments around line 2705 of subst.c would need to buried inside multsub() in such a way that any splitting owing to the top-level settings happened later --- which is very difficult since we rely on the nested substitution to do the splitting we see in the top-level parameter expansion because it parses it so knows how to split it. Whether there are remaining gotchas owing to ordering I don't know. Yuk. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog