Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Associative array sorting
- X-seq: zsh-workers 52488
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Associative array sorting
- Date: Fri, 19 Jan 2024 11:18:08 -0800
- Archived-at: <https://zsh.org/workers/52488>
- List-id: <zsh-workers.zsh.org>
I was just looking at this in the manual --
a
Sort in array index order; when combined with 'O' sort in reverse
array index order. Note that 'a' is therefore equivalent to the
default but 'Oa' is useful for obtaining an array's elements in
reverse order.
Like (o), (a) applies after the param is turned into an ordinary
array, so "equivalent to the default" kind of gets us off the hook,
but this would be the obvious place to attach sorting the associative
array by key rather than by raw hash traversal.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author