Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strange glob expansion
- X-seq: zsh-users 2549
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Hubert Canon <Hubert.Canon@xxxxxxxx>, zsh-users@xxxxxxxxxxxxxx
- Subject: Re: strange glob expansion
- Date: Wed, 1 Sep 1999 17:46:08 +0000
- In-reply-to: <19990901101116.A8076@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <19990901101116.A8076@xxxxxxxxxxxxxxxxx>
On Sep 1, 10:11am, Hubert Canon wrote:
} Subject: strange glob expansion
}
} I tried something like this :
}
} % echo .scwm/(chan*|**/scwmrc*)
Directory separators can't be used inside parentheses. Parenthesized
patterns match within one level of file hierarchy only. (The '/' may
still be useful when matching against strings, as in a `case' label, but
doesn't work when globbing.)
Since ** matches in the current directory as well as in subdirectories,
what you really wanted was
% echo .scwm/**/(chan*|scwmrc*)
Or perhaps
% echo .scwm/{chan*,**/scwmrc*}
Or maybe (if you have extendedglob set)
% echo .scwm/**/(chan*|scwmrc*)~*/*/chan*
Where the trailing bit with the tilde excludes files that match chan* in
subdirectories.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author