Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $var not expanded in ${x?$var}
- X-seq: zsh-workers 51304
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Stephane Chazelas" <stephane@xxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxx>
- Subject: Re: $var not expanded in ${x?$var}
- Date: Mon, 16 Jan 2023 08:35:54 +0000
- Archived-at: <https://zsh.org/workers/51304>
- Feedback-id: i425e4195:Fastmail
- In-reply-to: <20230113080246.nghigc4givvaomve@chazelas.org>
- List-id: <zsh-workers.zsh.org>
- References: <20230113080246.nghigc4givvaomve@chazelas.org>
Stephane Chazelas wrote on Fri, 13 Jan 2023 08:02 +00:00:
> $ zsh -c 'echo ${1?$USERNAME}'
> zsh:1: 1: $USERNAME
>
> No quote removal either:
>
> $ zsh -c 'echo ${1?"x"}'
> zsh:1: 1: "x"
>
Thanks for the report.
> (also note that line number being printed twice)
No, it's not. The second "1" is the parameter name:
$ zsh -fc 'echo ${foo?$USERNAME}'
zsh:1: foo: $USERNAME
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author