Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: get keys of an associative array?



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