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

Is there an idiom for converting an array to an associative array?



I'm looking for an idiom that will convert the array (a b c) into
(a "" b "" c "") so I can assign it easily to an associative array.

Right now I've got ugliness like this:

    array=(a b c)
    set -A assoc
    for i in $array; do
        assoc[$i]=""
    done

Any pointers?

-- 
matt



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