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

Re: Copy assiociative arrays



Am 21.03.2012 22:46, schrieb Moritz Bunkus:
> Hey,
> 
> what about
> 
> $ declare -A foo bar
> $ foo=(a 42 b 54)
> $ bar=(${(kv)foo})
> $ print ${(kv)bar}
> a 42 b 54
> 
>> using this, bar only contains the values of foo (and using ${(kv)foo}
>> instead still only makes it a string).
> 
> Yes, because you didn't put it into parenthesis, bar=${(kv)foo} vs
> bar=(${(kv)foo})

This makes sense. Thanks for the pointer :)

- René


Attachment: signature.asc
Description: OpenPGP digital signature



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