From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id UAA24865 for ; Fri, 10 Nov 1995 20:08:28 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA09722; Fri, 10 Nov 1995 03:54:33 -0500 Old-Return-Path: Resent-Date: Fri, 10 Nov 95 08:53:43 +0000 Old-Return-Path: Message-Id: <26908.9511100853@pygmy.swan.ac.uk> To: John.Cooper@eng.sun.com (John S Cooper) Cc: zsh-users@math.gatech.edu (Zsh users list) Subject: Re: how can I skip globbing through SCCS subdirs? In-Reply-To: "John.Cooper@eng.sun.com"'s message of "Thu, 09 Nov 95 19:11:44 PST." <199511100311.TAA07019@kontiki.Eng.Sun.COM> Date: Fri, 10 Nov 95 08:53:43 +0000 From: P.Stephenson@swansea.ac.uk X-Mts: smtp Resent-Message-Id: <"Q2k752.0.dN2.yAnem"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/125 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu John.Cooper@eng.sun.com 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 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.