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

Short-circuiting array-subscript glob qualifier?



Let's say I have a directory /foo/bar that contains a large number of files and subdirectories.  When I do this:

echo /foo/bar/**/^*,v(.[1,3])

I want it to echo the first three matching non-,v plain files.  Unfortunately, zsh still retrieves all filenames that match the glob.  How possible is it to have the glob stop as soon as the first 3 matches are found?  I realize that other qualifiers could affect this (for example, if you wanted the last 3, clearly, the whole glob has to be completed; if you used 'o' or 'O' to sort, you might still have to glob everything).  Perhaps this isn't worth the effort or is quite difficult, but it's sure handy for large directories wherein you only need a well-defined subset of the files that isn't controlled solely by the glob _expression_.

--
Shawn Halpenny


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