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

Help with associative arrays



I can't seem to figure this out.  I'm trying to use an associative array
and the results are not what I expect:

#!/usr/bin/env zsh

emulate -LR zsh

typeset -A repos
repos["conky"]="https://github.com/brndnmtthws/conky.git";

nickname="conky"
echo "nickname = " \"$nickname\" "repos = " \"${repos[$nickname]}\"
echo "nickname = " \"$nickname\" "repos = " \"${repos["conky"]}\"

yileds:

nickname =  "conky" repos =  ""
nickname =  "conky" repos =  "https://github.com/brndnmtthws/conky.git";

given that nickname is "conky" I expected the values to be the same.

Puzzled,
  Vin


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