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 8:51 AM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>
> On Mon, Nov 29, 2021, at 10:31 AM, Vincent Bernat wrote:
> > The (z) expansion flag is documented to return an array
>
> Is it?  The 5.8 man page does not mention "array" even once.

True, but "split" usually implies $@ -variety results.  Also:

>         [...].  So to access single words in the result use nested
>         expansions as in `${${(z)foo}[2]}'.

That would lead one to believe that ${${(z)foo}[1]} also returns a
single word, but as PWS notes the context may alter that.




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