From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23993 invoked by alias); 6 Nov 2015 11:12:26 -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: 37072 Received: (qmail 19712 invoked from network); 6 Nov 2015 11:12:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: Inconsistency with SHWORDSPLIT and leading spaces Date: Fri, 06 Nov 2015 11:54:49 +0100 Message-ID: <87a8qr75za.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host53-2.natpool.mwn.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) 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 http://chneukirchen.org