From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12022 invoked from network); 16 Jan 1997 13:59:00 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 16 Jan 1997 13:59:00 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA27346; Thu, 16 Jan 1997 09:05:05 -0500 (EST) Resent-Date: Thu, 16 Jan 1997 09:05:05 -0500 (EST) Date: Thu, 16 Jan 1997 17:07:29 +0300 (MSK) From: Andrej Borsenkow X-Sender: bor@itsrm1.mow.sni.de Reply-To: borsenkow.msk@sni.de To: Zsh workers mailing list Subject: Order of field splitting in zsh Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"vbHwp2.0.Ch6.GMZto"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2799 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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: % sh #where sh is linked to zsh % args a$(echo a b)b${IFS::=:} 3 aa bb % (the third being null string). If I understand POSIX specs right, it should give _two_ arguments ('aa bb' and empty). This example is obviously artificial; I fail currently to state if it can be a problem in real life or not. (Note, that ${var::=val} is illegal in POSIX; I use it to just demonstrate order of substitutions). 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 -------------------------------------------------------------------------