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

Re: ANDing Glob Qualifiers



On Sat, Sep 29, 2007 at 08:14:46PM +1200, Atom Smasher wrote:
> man zshexpn; FILENAME GENERATION; Glob Qualifiers
> line 1765...
>
> 	More than one of these lists can be combined, separated by commas. The 
> whole list matches if at least one of the sublists matches (they are 
> `or'ed, the qualifiers in the sublists are `and'ed).  Some qualifiers, 
> however, affect all matches generated, independent of the sublist in which 
> they are given.
>
> is it possible to AND two or more qualifiers? i read the part about 
> BARE_GLOB_QUAL and EXTENDED_GLOB (does the former even exist?) and i 
> haven't seen how to AND two or more qualifiers.
[...]

Not sure what you mean

*(.LK-1)

expands to the files that are "regular" AND "whose length is
less than 1kB".

*(.,LK-1)

expands to files that are either "regular" OR "whose length is
less than 1kB.

(*foo*|*bar*)

expands to files whose name contains either "foo" OR "bar"

*foo*~^*bar*

(with EXTENDED_GLOB) expands to files whose name contains both
"foo" AND "bar".

-- 
Stéphane



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