Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $var not expanded in ${x?$var}



On Mon, Feb 19, 2024 at 11:05 PM Stephane Chazelas
<stephane@xxxxxxxxxxxx> wrote:
>
> $ echo ${1?$'a\nb'}
> zsh: 1: a\nb
> $ print -Prv err '%F{red}BAD%f'
> $ a=${1?$err}
> zsh: 1: ^[[31mBAD^[[39m
>
> That transformation of newline into \n and other nicezputs'ness
> seems undesirable to me though.

It's probably worthwhile for utils.c:zerrmsg() to have a %-placeholder
that means a literal string.  Not hard to do, just need to choose a
letter.  %S ?




Messages sorted by: Reverse Date, Date, Thread, Author