Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Help with associative arrays
- X-seq: zsh-workers 39084
- From: Vin Shelton <ethersoft@xxxxxxxxx>
- To: "Zsh Hackers' List" <zsh-workers@xxxxxxx>
- Subject: Help with associative arrays
- Date: Sun, 21 Aug 2016 16:50:38 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:from:date:message-id:subject:to; bh=zcqu2yBbcazEl4k8z/cDb06K6UvSJgd/7/ZHB82ncHM=; b=XC+CvCEyHICV0Z7merPe11SxvDK20lN+BvU/aqJpG2GmV2H4EhCNN0quqZt589Xudr HtxfacUtG8syWbIgOHdQEJ9MwFMiSt/BFOOvMTp5ur3qgfHMXBCfXYRe/wCLQpa3v+vz L5BJaPBZWWLXCSEtGzrV9A8kpX4P2R1w+ByQXUdi9mi8ENar3XVFZvlf/xpoiVGU5dKG XJj0ecQ54LmRTo8t6PCQtqWg3RWr3+MBC5lTDKP1dHAlFmFrdy2TjmdkHIM3tCGGgBQ/ mQx2cKK0WWfYfV3B5dwklsKo4WlnjozSVxdbmv/he43slTzmzlbPJ/4goQzu5wCl5KPg XZWg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Reply-to: acs@xxxxxxxxxxxxxxxxxxxx
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