Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Expand each array element with ${(P)...}
- X-seq: zsh-users 29644
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Roman Perepelitsa" <roman.perepelitsa@xxxxxxxxx>, "Marlon Richert" <marlon.richert@xxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: Expand each array element with ${(P)...}
- Date: Tue, 06 Feb 2024 02:40:34 -0500
- Archived-at: <https://zsh.org/users/29644>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAN=4vMrFE1aCmdjLAcCFp25r=2LPWF74K8=1kZPUEXgrNr8R8Q@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAHLkEDt7_JcL2gX7b+DFbmwt+FaR_TfQftronc_47rOC4=Nttg@mail.gmail.com> <CAN=4vMrFE1aCmdjLAcCFp25r=2LPWF74K8=1kZPUEXgrNr8R8Q@mail.gmail.com>
On Tue, Feb 6, 2024, at 2:25 AM, Roman Perepelitsa wrote:
> I don't know if there is a better way.
I'm not sure there is. If you nest (P) to delay its application,
the shell explicitly complains about the very thing Marlon wants
to do:
% names=(a b c)
% : ${${(P)names}}
zsh: parameter name reference used with array
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author