zsh-workers
 help / color / mirror / code / Atom feed
* Inconsistency with SHWORDSPLIT and leading spaces
@ 2015-11-06 10:54 Christian Neukirchen
  2015-11-06 17:00 ` Peter Stephenson
  0 siblings, 1 reply; 18+ messages in thread
From: Christian Neukirchen @ 2015-11-06 10:54 UTC (permalink / raw)
  To: zsh-workers

Hi,

I noticed the following different behavior trying to use zsh as /bin/sh:

juno ~% dash -c 'x=foo; echo x${x:+ $x}' 
x foo
juno ~% bash -c 'x=foo; echo x${x:+ $x}' 
x foo
juno ~% mksh -c 'x=foo; echo x${x:+ $x}' 
x foo
juno ~% ksh -c 'x=foo; echo x${x:+ $x}' 
x foo
juno ~% zsh -c 'x=foo; echo x${x:+ $x}' 
x foo
juno ~% zsh -c 'emulate -L sh; x=foo; echo x${x:+ $x}'           
xfoo
juno ~% zsh -c 'emulate -L ksh; x=foo; echo x${x:+ $x}' 
xfoo
juno ~% zsh -c 'setopt shwordsplit; x=foo; echo x${x:+ $x}' 
xfoo

zsh 5.1.1 (x86_64-unknown-linux-gnu)
zsh-5.1.1-0-g68405f3

It's not clear to me whether this is *actually* POSIX-nonconformant, but
it's at least surprising compared to the other POSIX-compatible shells.

Thanks,
-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <0faa0ee3-303a-4cb5-a270-d3d1787accf1@email.android.com>]

end of thread, other threads:[~2015-11-15  5:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 10:54 Inconsistency with SHWORDSPLIT and leading spaces Christian Neukirchen
2015-11-06 17:00 ` Peter Stephenson
2015-11-07 17:42   ` Peter Stephenson
2015-11-07 19:43     ` Bart Schaefer
2015-11-08 18:18       ` Peter Stephenson
2015-11-08 18:55         ` Bart Schaefer
2015-11-09  6:03           ` Bart Schaefer
2015-11-11 17:49         ` PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces) Peter Stephenson
2015-11-11 18:13           ` Bart Schaefer
2015-11-11 21:55           ` Peter Stephenson
2015-11-12  9:46             ` Peter Stephenson
2015-11-12 14:19               ` Peter Stephenson
2015-11-13  8:17                 ` Jun T.
2015-11-13 15:07                   ` Jun T.
2015-11-14  1:33                     ` Bart Schaefer
2015-11-14  9:45                       ` Peter Stephenson
2015-11-14 18:51                         ` Bart Schaefer
     [not found] <0faa0ee3-303a-4cb5-a270-d3d1787accf1@email.android.com>
2015-11-15  5:14 ` Bart Schaefer

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