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

Re: (z) expansion flag do not always return an array



On Mon, Nov 29, 2021 at 7:31 AM Vincent Bernat <bernat@xxxxxxxx> wrote:
>
>  16:29 ❱ print -l ${${(Az)${:-word1}}[1]}
> word1
>
> But older versions of Zsh does not have that. Is there another way?

The only way I can come up with is to append a dummy extra element; instead of

 ${${(z)something}[1]}

use

 ${${(z)${:-$something \\}}[1]}




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