From: Vin Shelton <ethersoft@gmail.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Help with associative arrays
Date: Sun, 21 Aug 2016 16:50:38 -0400 [thread overview]
Message-ID: <CACeGjnUfMEo5KtdMn=iiAVsfAJgjeVyk7vh+WFZgcyKeahBbnQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
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
next reply other threads:[~2016-08-21 20:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-21 20:50 Vin Shelton [this message]
2016-08-21 21:18 ` Lawrence Velázquez
2016-08-22 11:53 ` Vin Shelton
2016-08-23 15:54 ` Stephane Chazelas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACeGjnUfMEo5KtdMn=iiAVsfAJgjeVyk7vh+WFZgcyKeahBbnQ@mail.gmail.com' \
--to=ethersoft@gmail.com \
--cc=acs@alumni.princeton.edu \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).