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

Re: Sorting files by their extension



On Aug 14,  5:40pm, Jean-Rene David wrote:
} Subject: Sorting files by their extension
}
} Has anyone got a ready-made way to do this?

It's pretty much impossible to do as a glob qualifier, because sorting is
the very last thing to happen, after all the other qualifiers are done.
You can play games if you don't need the actual file name, or by first
assigning to an array variable and then manipulating the array, but with
only filename generation you're out of luck.

  x=( *(e%'reply=( $REPLY:e/$REPLY )'%) )
  print -l $x:t

Aside to PWS:  It appears that as a side-effect of the *(+func) syntax,
it is no longer possible to use "+" as the delimiter in *(e+'stmt'+).
This should at least be documented.



Messages sorted by: Reverse Date, Date, Thread, Author