Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: syntax question
- X-seq: zsh-users 23270
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: syntax question
- Date: Fri, 23 Mar 2018 17:44:42 +0100
- Cc: zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAH+w=7ZYafX9MB0GcKnc5Cbj4GwR74KY196EcA6SZoSRUqiyLA@mail.gmail.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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <f53fb4de-0df9-610e-cbc5-784d37f1f558@eastlink.ca> <CAH+w=7ZYafX9MB0GcKnc5Cbj4GwR74KY196EcA6SZoSRUqiyLA@mail.gmail.com>
On 22 marca 2018 at 02:30:52, Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> On Wed, Mar 21, 2018 at 4:15 PM, Ray Andrews wrote:
> > ${${(z)string}[1]}
> >
> > ${(z)string[1]}
> >
> > ... How can that mean anything different?
>
> Operator precedence. The second one is equivalent to
> ${(z)${string[1]}}, as you observed.
Also, better to use (Az), utilizing your underrated patch, because:
% a='abcd'
% echo ${${(z)a}[1]}
a
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author