Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Excluding files in CVS directories in filename generation
- X-seq: zsh-users 6852
- From: Pavol Juhas <juhas@xxxxxxxxxx>
- To: "Zsh Users' List" <zsh-users@xxxxxxxxxx>
- Subject: Re: Excluding files in CVS directories in filename generation
- Date: Mon, 8 Dec 2003 13:14:34 -0500
- In-reply-to: <87r7zffbz5.fsf@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Zsh Users' List <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <10346.1070904549@xxxxxxx> <87r7zffbz5.fsf@xxxxxxxxxxxxxxxxxxxxxx>
On Mon, Dec 08, 2003 at 07:36:30PM +0200, Hannu Koivisto wrote:
> Peter Stephenson <pws@xxxxxxx> writes:
>
> > Yes, indeed. Luckily, you can do:
> >
> > (^CVS/)#*(.)
> >
> > This is the more general form of ** --- the pattern in the parentheses
> > is used (here anything but the string CVS) instead of a `*' to match
> > directory names. More precisely,
> > **/
> > (*/)#
> > are equivalent. That's why you don't need another / after the
> > parentheses.
>
> Excellent, thanks! I was aware of the general form but couldn't
> think of actually using it to solve this problem :)
>
> I would be interested to know why **/*~**/CVS/*(.) didn't work,
> though.
The exclusion pattern after ~ does not treat "/" or "**/" specially. As
far as I understand, the pattern is then used in the same way as for
string matching. So if **/* generates CVS/Entries, it is not excluded,
because [[ CVS/Entries != **/CVS/* ]] . To exclude the CVS directory
and all files below, you can use **/*~(*/)#CVS(/*)# Another way is
**/*~*CVS* , however this would also exclude filenames that contain
"CVS" string (e.g., aCVSb or CVS1/file).
HTH,
Pavol
Messages sorted by:
Reverse Date,
Date,
Thread,
Author