From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2925 invoked from network); 22 Jan 1997 16:20:32 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 22 Jan 1997 16:20:32 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA09667; Wed, 22 Jan 1997 10:57:07 -0500 (EST) Resent-Date: Wed, 22 Jan 1997 10:57:07 -0500 (EST) Date: Wed, 22 Jan 1997 18:58:34 +0300 (MSK) From: Andrej Borsenkow X-Sender: bor@itsrm1.mow.sni.de Reply-To: borsenkow.msk@sni.de To: Zoltan Hidvegi cc: zsh-workers@math.gatech.edu Subject: Re: Order of field splitting in zsh In-Reply-To: <199701161555.QAA10160@bolyai.cs.elte.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"1Iomg1.0.zM2.IZZvo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2815 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Thu, 16 Jan 1997, Zoltan Hidvegi wrote: > Andrej Borsenkow wrote: > > > > POSIX.2 defines the following order of expansions in sh: > > > > 1. tilde expansion, parameter expansion, command substitution, arithmetic > > expansion > > 2. field splitting (_after_ the above) > > 3. pathname expansion (globbing) > > 4. qoute removal. > > > > It seems, that zsh (even if invoked as sh) does field splitting on result > > of command substitution _immidiately_ after getting the value. The > > example is: > > ... > > You are right but that can only cause problems when IFS changes in step > one, and under POSIX it can only happen when it was set to the empty string > previously. I checked AT&T ksh and pdksh: > ... > > As you see ksh behaves like zsh. Bash behaves as POSIX requires. But I do > not think it is a real problem, and the fix would just complicate the code > unnecessarily. Note that both ksh I tested claims POSIX compilance. > There is more simple case: % ./sh (where sh -> /bin/zsh) % args $(echo 'a ')$(echo 'b') ^ note blank here (or any IFS white space) 1 ab % /bin/ksh % args $(echo 'a ')$(echo 'b') 2 a b % The same with /bin/sh (well, my /bin/sh doesn't understand $(...) but with `...` it behaves like ksh). greetings ------------------------------------------------------------------------- Andrej Borsenkow Fax: +7 (095) 252 01 05 SNI ITS Moscow Tel: +7 (095) 252 13 88 NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de -------------------------------------------------------------------------