From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13030 invoked by alias); 15 Jul 2017 17:27:01 -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: 41433 Received: (qmail 8600 invoked from network); 15 Jul 2017 17:27:01 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-10.server.virginmedia.net 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(80.0.253.74):SA:0(-2.8/5.0):. Processed in 2.1785 secs); 15 Jul 2017 17:27:01 -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=-2.8 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.74 as permitted sender) X-Originating-IP: [86.21.219.59] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.1 cv=SeoKDalu c=1 sm=1 tr=0 a=utowdAHh8RITBM/6U1BPxA==:117 a=utowdAHh8RITBM/6U1BPxA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=hD80L64hAAAA:8 a=lxTsISTPvXrHvU6QcPIA:9 a=CjuIK1q_8ugA:10 Date: Sat, 15 Jul 2017 18:19:50 +0100 From: Peter Stephenson To: "zsh-workers@zsh.org" Subject: Re: Array expansion interacts with brace expansion in the wrong order Message-ID: <20170715181950.3e3887f6@ntlworld.com> In-Reply-To: <20170714104555.0882ffe3@pwslap01u.europe.root.pri> References: <20170714094831.576c3d79@pwslap01u.europe.root.pri> <20170714104555.0882ffe3@pwslap01u.europe.root.pri> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1500139192; bh=yHrjvolxevJwkx1UdXsZRodZ8gnSmEgSMOG7YDBivxw=; h=Date:From:To:Subject:In-Reply-To:References; b=j++50e4x7kUUfhJTEqb3/TtATO4pQqeSHKeJQEaOhUuyhtcXNr6PmoVlbk5P3Hvfh MSG3EfN4S6jhuq9Mwi2988kzxgajGPosW/8BiwuuGxD/CBaQ0pn2hQKwTk/lhiXssQ WkJhQjRYgdJJzfPKs/UBEdEg5OUdmgwxu0v4iRJNOaqOwnKLSPuFi4AJCdoX4IL2Ck lwdxCu5Czbrx/dtzvYkgCKl8V6CPz4K5bln7LcDpo5V9cUbQym8lc+FsrIG48NquLT iY75XAsuwGypsInQO2tROJbEDw/qIZTmFKldzy5nlquyDlzVEtKukp8f2MNM9js/BA 6eHGfpmCIfVkA== On Fri, 14 Jul 2017 10:45:55 +0100 Peter Stephenson wrote: > This might be worth saying explicitly --- though things like this are > implicit throughout zsh's expansion rules. I wonder if it's also worth expanding the following? Having reread it in the light of Anders' query I realised "in one step" might be a bit misleading. Other suggestions welcome. I'm not, to be honest, quite sure what "in one step" really meant. I think it meant the each command line argument was changed completely before moving onto the next. But even if it did, that's not *quite* right if you consider that you might generate extra arguments from an earlier step which then need processing themselves in left to right order. All in all, I think obscuring the fact that the expansions happen one after the other is unhelpful, however we tackle it. pws diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index d161b0b..5b26f36 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -21,9 +21,12 @@ xitem(em(Parameter Expansion)) xitem(em(Command Substitution)) xitem(em(Arithmetic Expansion)) item(em(Brace Expansion))( -These five are performed in one step in left-to-right fashion. After -these expansions, all unquoted occurrences of the characters `tt(\)', -`tt(')' and `tt(")' are removed. +These five are performed in left-to-right fashion. On each argument, +any of the five steps that are needed are performed one after the other. +Hence, for example, all the parts of parameter expansion are completed +before command substitution is started. After these expansions, all +unquoted occurrences of the characters `tt(\)',`tt(')' and `tt(")' are +removed. ) item(em(Filename Expansion))( If the tt(SH_FILE_EXPANSION) option is set, the order of expansion is