From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29183 invoked by alias); 11 Mar 2018 20:53:55 -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: 42448 Received: (qmail 20132 invoked by uid 1010); 11 Mar 2018 20:53:55 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f177.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(209.85.128.177):SA:0(-1.9/5.0):. Processed in 1.171871 secs); 11 Mar 2018 20:53:55 -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_H2,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=PmonZFIKVMDR6gCTwsNfAbn/LnOZ91k5A7mKFGolpqA=; b=iw5+y7lu4w8EZFheZlAALXLuBG42sApWAlRfeETcI3lee7hfRRo8Ps8e5x8UwiXxwa BG6HNmBMZbEUC8tVBNmVO5RP0XCYMg9P8Uwg6qcB7TgwamOI9fR6caCRaZ3bQz/qF9c3 4PdVtLYZbhHh+q7/cq/Kc5qBvm+dmePOa6bTMpr8vZj985eRTH37YkzYsUUFchpMdWHG /tDc6gALVIVTGjnZBf+GFUHMe8tjyzcRUnDexN/hg8qw4GW6DKvbenbSg2tYYAf0+njQ Ij3yTZY79/uvDZlhu29B+PXp6eui0h7ulOjujKPIPHbEDQNKT1/OClAnUHrxsWmHqGzL 0qrA== 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=PmonZFIKVMDR6gCTwsNfAbn/LnOZ91k5A7mKFGolpqA=; b=gI0nqZ5+Aesgfyu5TlwEefs2jhmJuU6tn41RtJqq1b/a5Js53S1XxYVvFfSpF3BhGd 9dp9gsbxOupF1AEPeiJY9orOvcHJAXbIAJnLiqNdGADd5Zh1Lg9wrw74lvLQrv5ccTpR jISLqp4QLyi3MpmdIOrUaMJiCDoJoOYD2J1z/1np8gpOGcvfZQUixgnMtu+JqrPDreZE XGD6Sif0XtgvGfmGcYI1+6WwzvN8D6hXmJXJ4RozxjoflNRlPlu7Wc5EBcOMt4kXhBHk ttsnkXVoao9heq0HNqX0mv1O3jYSO5tTv3vRuEyP6q5ZqRVF2wjfT7mLJpDf5TKrSiyt T9Cg== X-Gm-Message-State: AElRT7Fih/3vnx0ulF44HUPkIQoTyjUpol449kqYYO7mkYQTcqUqq9n3 6qXB5irh92iK+wNsyXW/7AFLpQ== X-Google-Smtp-Source: AG47ELvfMwrLiuF+ADuhStJFOu2VnP/0athfAbuPNrm52jIeEJ1MJOJFvIquSiJG+2JUO+8GLO9nXA== X-Received: by 10.223.156.206 with SMTP id h14mr4068040wre.281.1520801630915; Sun, 11 Mar 2018 13:53:50 -0700 (PDT) Date: Sun, 11 Mar 2018 20:53:48 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: [doc] "sh_word_split nothing to do with word splitting"? Message-ID: <20180311205348.GC6450@chaz.gmail.com> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: <20180311094458.GA6450@chaz.gmail.com> <180311112407.ZM2303@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <180311112407.ZM2303@torch.brasslantern.com> User-Agent: Mutt/1.5.24 (2015-08-30) 2018-03-11 11:24:07 -0700, Bart Schaefer: > On Mar 11, 9:44am, Stephane Chazelas wrote: > } Subject: [doc] "sh_word_split nothing to do with word splitting"? > } > } SH_WORD_SPLIT (-y) > } Causes field splitting to be performed on unquoted parameter > } expansions. Note that this option has nothing to do with word > } splitting. (See *note Parameter Expansion::.) > > What this means to say: > > This option applies to field splitting within an expanded shell word, > not to splitting a command line into shell words during parsing. Thanks Bart for confirming that. What about changing it to something like: diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 25b3d57..7677f73 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -2314,9 +2314,17 @@ pindex(NOSHWORDSPLIT) cindex(field splitting, sh style) cindex(sh, field splitting style) item(tt(SH_WORD_SPLIT) (tt(-y)) )( -Causes field splitting to be performed on unquoted parameter expansions. -Note that this option has nothing to do with word splitting. -(See noderef(Parameter Expansion).) +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 and contrary to the Bourne shell, not on words +that are not the result of expansions. Like in other Bourne-like shells, +field splitting is only performed in contexts where several words may be +expected, such as in arguments to simple commands or anonymous functions, +array assignments and for loop word lists. If the tt(MULTIOS) option is +enabled, it is also performed in the targets of tt(<), tt(>) and tt(>>) +redirection operators. (See noderef(Parameter Expansion) and +noderef(Redirection)). ) pindex(TRAPS_ASYNC) pindex(NO_TRAPS_ASYNC) A reference to $IFS may also be useful. Is it possible to add references to index entries in yodl? (I only include the >, >>, < redirections, that's missing the clobber variants and the >& >>&... Not sure how to express it without making it too wordy). Not sure it's worth mentioning: $var() function-definition as a context where shwordsplit happens. See also https://unix.stackexchange.com/a/382914 -- Stephane