Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: get keys of an associative array?
- X-seq: zsh-workers 40905
- From: Jens Elkner <jel+zsh@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: get keys of an associative array?
- Date: Mon, 27 Mar 2017 00:06:28 +0200
- In-reply-to: <CAH+w=7YSv3th7qD9WFxrXrfuuCSGarbHZswTGW13JSHiY-irCQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170326191828.GA13089@trex.cs.ovgu.de> <20170326203446.45f5883e@ntlworld.com> <CAH+w=7YSv3th7qD9WFxrXrfuuCSGarbHZswTGW13JSHiY-irCQ@mail.gmail.com>
On Sun, Mar 26, 2017 at 01:03:31PM -0700, Bart Schaefer wrote:
> On Mar 26, 2017 12:41 PM, "Peter Stephenson" <p.w.stephenson@xxxxxxxxxxxx>
> wrote:
>
> You need "${(k)A[@]}" in ksh mode, but I'm not sure why the (@) flag
> doesn't do the trick.
>
> The @ flag only makes things that are already arrays remain arrays in
> contexts where they would otherwise be joined. In ksharrays context, ${A}
> is a scalar.
You mean man page section for the k flag needs enhancements? At least A
is explictly declared as an associative array, so I would expect, that
"${(k)A}" should work as well ...
Thanx,
jel.
--
Otto-von-Guericke University http://www.cs.uni-magdeburg.de/
Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany Tel: +49 391 67 52768
Messages sorted by:
Reverse Date,
Date,
Thread,
Author