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

creating associative arrays



Hello,

I am trying to fill an associative array from a file.  If the name of
the file is fixed, e.g. array.txt then the following works:

: ${(AA)dict::=$(<array.txt)}

However, if the filename is given in a parameter then the command:
: ${(AA)dict::=$(<${filename})}
gives the error
zsh: bad set of key/value pairs for associative array.

I guess I am mixing up some kind of expansion order, so could somebody
help?

Thanks in advance,
Akos



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