From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15448 invoked by alias); 25 Nov 2014 12:12:24 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19430 Received: (qmail 1778 invoked from network); 25 Nov 2014 12:12:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=Tj16AxUxHCOHx098eXsCz+iKmZ/QMqNF4QvGTRBNrjI=; b=T2Mh8Y9kx85W0269A156CAQqA7mcPq8WMQtnzbtYm3mpow7qvsUosW8yN0BoiITC5H tMwECphHssRNGDP8/024yJtZ4bS5dFS4OVp03iPEXuLO+x2BwLKGtOGK579g+VDWYgdl EE17klKH7m/NuOXx9lIgjXKkQjeHsiw6wlIYGpyYp8FVZohtkrlw6RvjbWibIHNdJ0JD eHwGAgi9aLCXAg/MLlLnVO0ht5G0/BwVfpTw52CKT41HyrV0rxnvVkfFhwsZRkYQx7NI Rr4xUvtEkmYjGKE0TszXPEpY8pnVZowj2dsTNw73PPHpxoj/E4Bi/Dk9osWp1mlw5aJ5 s1ig== X-Received: by 10.180.95.201 with SMTP id dm9mr30098805wib.27.1416917536445; Tue, 25 Nov 2014 04:12:16 -0800 (PST) Date: Tue, 25 Nov 2014 12:12:14 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: ${^var} and word splitting Message-ID: <20141125121214.GA6108@chaz.gmail.com> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: <20141124095637.GA5716@chaz.gmail.com> <20141124111201.161d8cf2__23261.8202259347$1416827641$gmane$org@pwslap01u.europe.root.pri> <20141124152628.GA5749@chaz.gmail.com> <20141124155524.0739b3ec__26419.4987401881$1416845250$gmane$org@pwslap01u.europe.root.pri> <20141124211831.GA17829@chaz.gmail.com> <141124234931.ZM17259__8246.8130779036$1416901919$gmane$org@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <141124234931.ZM17259__8246.8130779036$1416901919$gmane$org@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2014-11-24 23:49:31 -0800, Bart Schaefer: [...] > } ~$ a=' a b ' zsh -c 'print -l ${(s, ,)a}' > } a > } b > } ~$ a=' a b ' zsh -c 'print -l "${(s, ,)a}"' > } > } a > } b > } > } ~$ a=' a b ' zsh -c 'print -l "${(s, ,@)a}"' > } > } a > } > } b > } > } ~$ > } > } I'd rather 2 above behave either like 1 or [3]. [...] > } It may be too late to change the behaviour now, though I'd find > } it hard to imagine people relying on "$=var" to make empty > } arguments at the beginning and end but not in the middle. > > I have the nagging suspicion there may be cases in the completion code > that expect exactly that ... or that have been programmed to work around > it and would need to be fixed if it changes. [...] I'd be surprised if it were the case. Anyway, if one wants 1, he can write it as 1, and if one wants 3, he can write it as 3. So, that's no big deal if 2 stays the way it is. It's just that I don't find it intuitive or /consistent/. 2 is specific to zsh anyway. Other shells don't split inside double quotes (except for ${array[@]}) and $^a is zsh-specific. So it's not a question of compatibility with other shells. zsh -o shwordsplit works like other shells where the behaviour is defined in other shells. -- Stephane