On Wed, Aug 26, 2026 at 10:32:25 -0600, Stan Marsh wrote: > From: Chet Ramey > Subject: Re: The "asort" extension (Was: feature proposal: expand associative > arrays in lexicographic order ...) > Date: Wed, 26 Aug 2026 10:30:48 -0400 > > >On 8/26/26 9:43 AM, Zachary Santer wrote: > > >That's a pretty high implementation and maintenance cost, not to mention > >a potential run-time cost, for a feature that historically no one has > >requested. > > *Somebody* must have requested it, or else the "asort" extension (the > subject of this thread) would never have been dreamed up and/or > implemented.
Sorting an indexed array, and iterating over an associative array's keys in *a* sorted order (out of several possible ones), are two very different tasks. > Surely, the need for traversing a bash associative array in alphabetical > order (or something like that) is not *that* new or novel. In a shell script, it's not common at all. Associative arrays are usually used to map inputs to outputs, or to track which inputs have already been seen, so as to avoid duplicating work. Traversing an associative array by keys is not a common task for shell scripts, in my experience.
