From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9302 invoked from network); 17 Aug 2007 22:16:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Aug 2007 22:16:09 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 27758 invoked from network); 17 Aug 2007 22:16:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Aug 2007 22:16:01 -0000 Received: (qmail 196 invoked by alias); 17 Aug 2007 22:15:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23774 Received: (qmail 186 invoked from network); 17 Aug 2007 22:15:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Aug 2007 22:15:57 -0000 Received: (qmail 27459 invoked from network); 17 Aug 2007 22:15:57 -0000 Received: from mtaout01-winn.ispmail.ntl.com (81.103.221.47) by a.mx.sunsite.dk with SMTP; 17 Aug 2007 22:15:53 -0000 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20070817221552.FGM1783.mtaout01-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com>; Fri, 17 Aug 2007 23:15:52 +0100 Received: from pws-pc.ntlworld.com ([81.107.45.67]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20070817221551.TLSH17393.aamtaout02-winn.ispmail.ntl.com@pws-pc.ntlworld.com>; Fri, 17 Aug 2007 23:15:51 +0100 Received: from pws-pc.ntlworld.com (pws-pc.ntlworld.com [127.0.0.1]) by pws-pc.ntlworld.com (8.14.1/8.13.8) with ESMTP id l7HMFalO004036; Fri, 17 Aug 2007 23:15:36 +0100 Message-Id: <200708172215.l7HMFalO004036@pws-pc.ntlworld.com> From: Peter Stephenson To: Nex Magik , zsh-workers@sunsite.dk Subject: Re: inconsistent behavior observed with export VAR=VAL versus VAR=VAL zsh 4.2.6 In-Reply-To: Message from Nex Magik of "Fri, 17 Aug 2007 12:29:27 PDT." <432520.66027.qm@web50101.mail.re2.yahoo.com> Date: Fri, 17 Aug 2007 23:15:36 +0100 Nex Magik wrote: > This is a strange issue, it has a workaround, but its still strange. > > The very short way to see it is to try to append an expression > with spaces in it to a variable. > > stimpy% Y="foo bar" ... > stimpy% export Z=$(/bin/echo $Y):$PATH > export: not an identifier: bar:/tmp/opt/spi/RapiDev_99a-RC1/tools/bin:/opt/gc > c-3.2.3/bin:/opt/python-2.4.4/bin:/usr/local/bin:/bin:/usr/bin:/home/jkim/bin > /exec/i686-Linux2:/home/jkim/bin/shell:/home/jkim/bin/shell/LOGIN/i686-Linux2 > stimpy If this is what you're worried about, it's not a bug. zsh applies completely consistent rules for arguments splitting of commands, including "export" and it's relatives, which means if you don't want $(...) expansions to be split into words then you must tell it not to. The standard way is to put double quotes around the expansion. However, if you want to change the behaviour permanently you can set the option KSH_TYPESET. See its documentation in the zshoptions manual. The case without "export" in front is treated differently because the expansion is no longer part of a command argument; the rules are different for shell assignments, with no word splitting being done on the right hand side of the assignment. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/