zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: "<zsh-users@zsh.org>" <zsh-users@zsh.org>
Subject: Re: Associative array, brace-free subscripting: key with spaces
Date: Thu, 29 Oct 2015 17:28:10 +0000	[thread overview]
Message-ID: <20151029172810.1f326658@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAKjp4B7B_S8T=ugeDRfe2sASJoVSY7UAwWFkBUFO9QszqjofPA@mail.gmail.com>

On Thu, 29 Oct 2015 13:17:17 -0400
Clint Hepner <clint.hepner@gmail.com> wrote:
> Consider the array
> 
>     typeset -A b
>     b=("a b c" d)
> 
> The following correctly expands to "d"
> 
>     ${b[a b c]}
> 
> but this results in a "bad subscript" error:
> 
>     $b[a b c]

Without the surrounding brace, the spaces separate words, so it looks at
"$b[a" and doesn't like it.

pws


      reply	other threads:[~2015-10-29 17:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 17:17 Clint Hepner
2015-10-29 17:28 ` Peter Stephenson [this message]

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=20151029172810.1f326658@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@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).