Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how can I skip globbing through SCCS subdirs?
- X-seq: zsh-users 125
- From: P.Stephenson@xxxxxxxxxxxxx
- To: John.Cooper@xxxxxxxxxxx (John S Cooper)
- Subject: Re: how can I skip globbing through SCCS subdirs?
- Date: Fri, 10 Nov 95 08:53:43 +0000
- Cc: zsh-users@xxxxxxxxxxxxxxx (Zsh users list)
- In-reply-to: "John.Cooper@xxxxxxxxxxx"'s message of "Thu, 09 Nov 95 19:11:44 PST." <199511100311.TAA07019@xxxxxxxxxxxxxxxxxxx>
John.Cooper@xxxxxxxxxxx wrote:
> I'm using extendedglob. How can I match all .c files in all
> subdirectories, _except_ any SCCS subdirectories?
>
> ls **~SCCS/*.c
The bad news is that ** handling bypasses most of the pattern code,
i.e. you can't actually exclude things while the ** list is being
expanded. The good news is that in the ~ part of the pattern, /'s are
not special. This means you can exclude SCCS directories like this:
ls **/*.c~(*/)#SCCS/*
The (*/)# is a trick so that top level SCCS directories are ignored as
well as any /SCCS/ bits in the middle somewhere.
By the way, as this shows, ~ has lower precedence than /. That's
because it was originally intended that you only use ~ the way I've
just done, i.e. with the whole pattern. However, you can now group it
using parentheses if you avoid using ** inside the parentheses (so it
doesn't solve your problem here).
> Ps. Is there a newsgroup for this alias?
No, sorry.
--
Peter Stephenson <pws@xxxxxx> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author