Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${(t!)nameref}; ${(t)${nested}}; Doc/zshall.1
- X-seq: zsh-workers 54081
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: ${(t!)nameref}; ${(t)${nested}}; Doc/zshall.1
- Date: Sun, 16 Nov 2025 04:15:49 +0000
- Archived-at: <https://zsh.org/workers/54081>
- Feedback-id: i425e4195:Fastmail
- In-reply-to: <CAH+w=7Z-v6sb2s1UeJm=B0Jh5JfXZjxPp0+bzXDNfm_1n3aZ=A@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <090334ff-8ebd-4596-a17f-4484e36f3145@app.fastmail.com> <CAH+w=7Z-v6sb2s1UeJm=B0Jh5JfXZjxPp0+bzXDNfm_1n3aZ=A@mail.gmail.com>
Bart Schaefer wrote on Wed, 12 Nov 2025 02:22 +00:00:
> Catching up on this (and mildly surprised no one else got to these
> tidbits before me) ...
>
> On Fri, Nov 7, 2025 at 10:46 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>> C. Here, a ${(t)…} expression expands to something not (t)-ey at all:
>>
>> % echo ${(t)${PATH}}
>> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
>
> That's because nested expansions work inside-out. Once you've
> expanded ${PATH} you don't have a parameter any more; (t) is defined
> on parameters, not on values.
In that case, shouldn't ${(t)${PATH}} give an error message?
I could see that syntax expanding to "scalar" v. "array", and I could
see it giving an error message; but the user did specify (t), so we should
either do what (t) is supposed to do, or error out, surely?
Thanks,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author