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

Re: indirect assignment to array



On Thu, 16 Apr 2020 at 01:14, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:

> : ${(PA)varname::=$array}
> (leave out the A for scalar assignment, and use AA for assoc arrays).
>

I would do:

: ${(PA)varname::="$array[@]"}

to not lose empty elements.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org


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