From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5454 invoked by alias); 16 Mar 2018 19:33:36 -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: 42472 Received: (qmail 18583 invoked by uid 1010); 16 Mar 2018 19:33:36 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f54.google.com 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(74.125.82.54):SA:0(-1.9/5.0):. Processed in 1.978753 secs); 16 Mar 2018 19:33:36 -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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7FLD9I57toUusxpwRX3XYw5YFHpmuBTQ1qoaHUuwwOs=; b=R7KXr1ztEEHHpvpPTuyKN/9+GvsLC4rMHpaq2oD05eWt4SfWKNEZvjhpVMdPt0iD05 kHBsLiAsYqRcCRxKeCWJnvpr2yyoyCn5Vt0TtO2Ny8ogz3GEMygekBDndfWHMGEuZSts 26vi8HH+AjF9izj1ZIq5vn3q49mPv+5bS/TN/kqDoPT85MrF1j5fGsH/qh5sQsBlZUts RzAZ/AVD1pkMSiYy4P5RJ4qxJU38iu517K1Rre11B2fJU0XaJ4aAwL389L8wL6HajzPA AB544YwzqxJ3fUUJiopU92plZLneIGUd4OtYc/M3RTo4WriZLdwcQZvRio/vxmrP+tyB Ah1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=7FLD9I57toUusxpwRX3XYw5YFHpmuBTQ1qoaHUuwwOs=; b=pbAwSOYfuZSTn3OYg+plK82jvuvomIs2+TwI7Qp0YjlzfSCBz9RmLFYdxKdbYCciuF bfwOlL9WGFzKGTgdsYHsj6bU7cetO1rYx/Uzu87rj1gyHaJsatIOPWelxa/+6GFi71wl 8Dkt9DVtlLqybvZdJvhYu/e82Y+uV5Kl8hJsRSrSQfuuw0B+sOzkMgUTZHGQ54YnDZkW j6ySOA13K0zwLjr4U48vk59fvANWkNoudQmEQGk43iHvEwzsxgHdHmjJGfwt/FojWNqa aWVJneUDVcj9d+7gM+zAz9zjLURS0N5+yNvVQ1VfOGmlj12ww0CJ63jLsIrSYsxpUoon B6/Q== X-Gm-Message-State: AElRT7EUzcDWnvr0QLRsLLvlvIrHiR322hj8sPFIWvgT7ljjAsd8a0Nb 3Crwpp85B5n/3esLw8riLt0Olw== X-Google-Smtp-Source: AG47ELsR0D/wiEMGuTF+q81Bl0+XujeQH4lGwbupty8KaKqhH6Ati3ggDTodkf10n3wSIArL1slipQ== X-Received: by 10.28.159.68 with SMTP id i65mr2819020wme.27.1521228810695; Fri, 16 Mar 2018 12:33:30 -0700 (PDT) Date: Fri, 16 Mar 2018 19:33:28 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Martijn Dekker , "zsh-workers@zsh.org" Subject: Re: [doc] "sh_word_split nothing to do with word splitting"? Message-ID: <20180316193328.GC23397@chaz.gmail.com> Mail-Followup-To: Bart Schaefer , Martijn Dekker , "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> <20180312080727.GB6416@chaz.gmail.com> <20180316172613.GB23397@chaz.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 2018-03-16 11:28:23 -0700, Bart Schaefer: > On Fri, Mar 16, 2018 at 10:26 AM, Stephane Chazelas > wrote: > > So, how about this new take at it? Renders (in info) as: > > > > SH_WORD_SPLIT (-y) > > Causes $IFS field splitting to be performed on unquoted parameter > > expansions in addition to command substitutions. Note that > > This is OK, I just keep thinking there should be a reference back to > the shell grammar; field splitting applies to anything identified in > the grammar by the token WORD provided that the WORD is not quoted. > Arithmetic expressions are treated as if double-quoted. That's really > all there is to it. Note that for $((text)), there's possible confusion. In the POSIX spec, the reference to "as if double quoted" is about the interpretation of text, not $((text)). In POSIX, in $(($1 + 2)), $1 is not subject to split + glob because $1 + 2 is treated as if quoted, but $(($1 + 2)) is *required* (!) to be split+globbed. As in: IFS=2; echo $((11 * 11)) is *required* to output 1 1 but zsh, even in sh emulation outputs "121" as everyone would expect. That's why I mention it in the text to clarify that it's an intentionaly deviation from the POSIX standard. (I will try and have POSIX lift that silly requirement but I have little hope they'll accept; note that a few shells have already gone out of their way to change their sensible behaviour to meet POSIX compliance on that front) -- Stephane