Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: get keys of an associative array?
- X-seq: zsh-workers 40903
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: get keys of an associative array?
- Date: Sun, 26 Mar 2017 13:03:31 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ldIv0hk7cWBkKbxkpOXkQ4UKEaaFf6xrg9JAMj/R7x4=; b=CMznplcDFZBpK6ZmEl8T2y4KxpPW80rOlaf6zbpKMzXiznMmpXkMU6V81rMAqNafWF j3hPiELQYuQNGOqvIBNXs6KK1vS1DZw3bSeBR0Wyqe9sjtt3YAaSx3YDC2+amKSDQ2qK PDAa1TqKK0FS1i0YYdCh0XjnyM7r34Eqy2skyJS3poz1X1JK/QlS6ci5uTYnj0rutj17 wcc9jTuAAO9uNLYk14VvTdYpsSDgRN8K7pJxeBXraOKFawYMdJiqGQHEv/ScYmxx4d38 jSZBDTxhzaFc8620omNI3f6rx8+FXRgmkvWQ2JThQ2j/ZfKfbm2GGkfUzKvlaW03XrPU rJsA==
- In-reply-to: <20170326203446.45f5883e@ntlworld.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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170326191828.GA13089@trex.cs.ovgu.de> <20170326203446.45f5883e@ntlworld.com>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author