Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${^var} and word splitting
- X-seq: zsh-users 19430
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: ${^var} and word splitting
- Date: Tue, 25 Nov 2014 12:12:14 +0000
- Cc: Zsh hackers list <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <141124234931.ZM17259__8246.8130779036$1416901919$gmane$org@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- 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>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author