Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Associative array, brace-free subscripting: key with spaces
- X-seq: zsh-users 20857
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: "<zsh-users@xxxxxxx>" <zsh-users@xxxxxxx>
- Subject: Re: Associative array, brace-free subscripting: key with spaces
- Date: Thu, 29 Oct 2015 17:28:10 +0000
- In-reply-to: <CAKjp4B7B_S8T=ugeDRfe2sASJoVSY7UAwWFkBUFO9QszqjofPA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAKjp4B7B_S8T=ugeDRfe2sASJoVSY7UAwWFkBUFO9QszqjofPA@mail.gmail.com>
On Thu, 29 Oct 2015 13:17:17 -0400
Clint Hepner <clint.hepner@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author