From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11196 invoked by alias); 26 Mar 2018 18:11:57 -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: 42537 Received: (qmail 16579 invoked by uid 1010); 26 Mar 2018 18:11:57 -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.939546 secs); 26 Mar 2018 18:11:57 -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> <20180312074329.GA6416@chaz.gmail.com> <20180325064254.GA5782@chaz.gmail.com> From: Martijn Dekker Message-ID: <3da133f5-197b-aa50-7827-f24085b5b192@inlv.org> Date: Mon, 26 Mar 2018 20:11:49 +0200 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: <20180325064254.GA5782@chaz.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Op 25-03-18 om 08:42 schreef Stephane Chazelas: > There have been many cases where POSIX have specified accidents > of implementation or design bugs of original implementations and > the POSIX specification has been fixed later on when spotted > even in some cases forcing the original implementation to be > fixed. > > IMO, here, it's clearly one of those. The solution here is not to > implement the bug but fix the specification. By that token, global field splitting and globbing themselves are massive design flaws (which they are -- as you know I've been working on a cross-shell way to make it practical to get rid of them). Yet, POSIX shells conform, at least in their respective POSIX modes. At least the current spec is consistent. All POSIX expansions are subject to global split & glob (unless those are disabled). Why would $( ... ) be subject to split+glob but not $(( ... ))? That would be a bit confusing, and would detract from quoting expansions consistently. I think consistent and broken is better than inconsistent and broken. > There are many "unspecified areas" in POSIX where it's the case, > if you rely on unspecified behaviour you can't expect anything > portably. I don't see that as a reason to add yet another unspecified behaviour. In practice we'd be stuck with it for a decade anyway, maybe two. To rephrase myself, I think specified and broken is better than unspecified and broken. > In the mean time, we should document the difference so it's no > longer "mysterious" like in my suggested patch. Yes, but what wonderful planet do you live on, where people actually read documentation? :) >> Then pdksh, supposedly a ksh88 clone, failed to clone ksh88 in that >> aspect -- among many others. > [...] > > pdksh has fixed a number of issues in ksh88 (itself broken on > many aspects as you've found out) as well. Another one shared > with zsh: that the ".*" glob does not include "." nor ".." (in > the case of pdksh actually inherited from the Forsyth shell). I don't really see that as a fix though, just as another mostly pointless difference causing incompatibility surprises. ksh93 matches '.' and '..' to this day. On zsh, it looks like another emulation bug. The SH_GLOB option should cause ".*" to match "." and "..". (Actually, modernish ought to detect this as a shell quirk with its own ID. Thanks for reminding me of it.) - M.