Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Short-circuiting array-subscript glob qualifier?
- X-seq: zsh-users 8772
- From: Shawn Halpenny <paxunix@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Short-circuiting array-subscript glob qualifier?
- Date: Tue, 3 May 2005 10:26:58 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=AJR3xAqgamDcxKQ7yxT/iC3icqBu/CfkL48DQPXrvJka+jZGyfZv9RuXl/aiOHPdqGBbcxVrcqH2O3WDmqsQ7HDD8OkpJ8TndhOzPk3Kjop416DKMH21Htmm2z+F/2UClelh7cQz4O0VKGWjjeHlOH6Ht/IpLXbKj9F8Sp6slgA=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: Shawn Halpenny <paxunix@xxxxxxxxx>
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