From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23138 invoked by alias); 9 Jan 2011 01:18:20 -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: 28604 Received: (qmail 24706 invoked from network); 9 Jan 2011 01:18:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110108171809.ZM2330@torch.brasslantern.com> Date: Sat, 08 Jan 2011 17:18:09 -0800 In-reply-to: <20110108215239.059062c3@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: exec -a and parameter expansion" (Jan 8, 9:52pm) References: <8739p4wekt.fsf@gmail.com> <20110107225616.GA99800@redoubt.spodhuis.org> <110107181708.ZM628@torch.brasslantern.com> <20110108215239.059062c3@pws-pc.ntlworld.com> <20110108222902.67a13bd2@pws-pc.ntlworld.com> In-reply-to: <20110108222902.67a13bd2@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: exec -a and parameter expansion" (Jan 8, 10:29pm) X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: exec -a and parameter expansion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 8, 9:52pm, Peter Stephenson wrote: } Subject: Re: exec -a and parameter expansion } } On Fri, 07 Jan 2011 18:17:06 -0800 } Bart Schaefer wrote: } > So either there are some missing test cases for other things that } > this would cause to break, or we should rearrange execcmd() so that } > "typeset" is the only special-cased builtin ahead of prefork(). } } I could be convinced the latter is correct. Apart from KSH_TYPESET, } nothing stands out in my mind as needing special behaviour during the } expansion phase. A careful search of the manual might be warranted. There is at least one complication, which is that "builtin typeset ..." should work the same as "typeset". And then there's noglob builtin typeset builtin noglob typeset exec builtin noglob typeset nocorrect exec noglob builtin typeset and so on. } There was some discussion of the KSH_TYPESET behaviour on the Austin } group list; [...] it might have been worse and and you were expected } to handle: } } t=typeset } $t foo=`echo one two` } } such that foo was assigned the value "one two". What this boils down to is that processing the entire command line at once in prefork() can't be done. You have to apply the prefork substitutions to each word before deciding what to do with the next, at least until you reach one of "command", "typeset", a non-special builtin, or an external command. Or prefork has to become clever enough to manage that part ...