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

(Y) modifier: up to N matches?



Right now,   *(NY) expands to either zero or one filenames.

Would it make sense to have (Y) take a numeric argument specifying the maximal
number of files to match?  e.g., *(NY5) would expand to between 0 and 5
filenames (but never more than 5).

I think it will be a small code change (just check matchct when deciding
whether to return) and will work nicely with other qualifiers (eg sorting)
without special effort.  It would be a superset of the current functionality
[(NY1) would be equivalent to the current (NY)].

I imagine it would be useful in cases where 'find | head' or 'grep | head' are
useful.

Thoughts?



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