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

Re: Short-circuiting array-subscript glob qualifier?



On May 3, 10:26am, Shawn Halpenny wrote:
} 
} 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.

Yep, that's right.  All qualifiers that work on the file names (rather
than on the filesystem attributes) are applied once to the entire list
after the glob is done.  Well, that's not quite right -- expressions
evaluated with (e:...:) are applied to each file as it is found, too,
but there's no provision for that to short-circuit the entire glob.

} How possible is it to have the glob stop as soon as the first 3
} matches are found?

Can't be done using glob patterns.



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