zsh-workers
 help / color / mirror / code / Atom feed
* Order of field splitting in zsh
@ 1997-01-16 14:07 Andrej Borsenkow
  1997-01-16 15:55 ` Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Andrej Borsenkow @ 1997-01-16 14:07 UTC (permalink / raw)
  To: Zsh workers mailing list


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
-------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-01-22 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-16 14:07 Order of field splitting in zsh Andrej Borsenkow
1997-01-16 15:55 ` Zoltan Hidvegi
1997-01-22 15:58   ` Andrej Borsenkow
1997-01-22 21:59     ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).