From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14264 invoked by alias); 12 Mar 2018 00:10:45 -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: List-Unsubscribe: X-Seq: 42449 Received: (qmail 8721 invoked by uid 1010); 12 Mar 2018 00:10:45 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(37.59.109.123):SA:0(-1.9/5.0):. Processed in 1.877081 secs); 12 Mar 2018 00:10:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Subject: Re: [doc] "sh_word_split nothing to do with word splitting"? To: zsh-workers@zsh.org References: <20180311094458.GA6450@chaz.gmail.com> <180311112407.ZM2303@torch.brasslantern.com> <20180311205348.GC6450@chaz.gmail.com> From: Martijn Dekker Message-ID: Date: Mon, 12 Mar 2018 00:41:03 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180311205348.GC6450@chaz.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Op 11-03-18 om 21:53 schreef Stephane Chazelas: > What about changing it to something like: [...] > +Causes tt($IFS) field splitting to be performed on unquoted parameter > +expansions in addition to command substitutions. Note that contrary to > +POSIX shells, field splitting is still not performed on unquoted > +arithmetic expansions In terms of sh emulation, that's actually a bug. It may be terrible (who would ever want to split an arithmetic expansion?), but emulation is emulation and SH_WORD_SPLIT should cause splitting as in POSIX sh. > and contrary to the Bourne shell, not on words > +that are not the result of expansions. Now that even Solaris finally got rid of it, I think the ancient Bourne shell is definitively obsolete and not worth mentioning in current documentation. POSIX is the norm now. > Like in other Bourne-like shells, I'd say "Like in other POSIX shells,". [...] > Not sure it's worth mentioning: > > $var() function-definition > > as a context where shwordsplit happens. It might be better if the possibility to define functions by names resulting from expansions were disabled completely if SH_WORD_SPLIT is active, so the program fails properly instead of producing weird/broken behaviour. Alternatively, SH_WORD_SPLIT could be ignored in that context. - M.