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

Re: zsh adds empty string to local parameter when += is used



Thanks Peter S for your amazing explanation. That is enough for me.

I had given up on getting an explanation but that is excellent news.

I will be using `local -a` and your other suggestions in the future.

Cheers,

J

On 20/01/2021 13:31, Daniel Shahaf wrote:
jamil bio wrote on Wed, Jan 20, 2021 at 13:16:54 -0300:
         echo "${#files[@]} -- ${files[@]}"

2 --  file1
3 --  file1 file2
4 --  file1 file2 file3
For future reference, there's «typeset -p files» and «print -r -- "${(q)files}"».




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