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 HAA18967 for ; Sat, 11 Nov 1995 07:27:21 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA15187; Fri, 10 Nov 1995 15:13:13 -0500 Old-Return-Path: Resent-Date: Fri, 10 Nov 1995 11:09:41 -0800 Old-Return-Path: Date: Fri, 10 Nov 1995 11:09:41 -0800 From: John.Cooper@Eng.Sun.COM (John S Cooper) Message-Id: <199511101909.LAA08306@kontiki.Eng.Sun.COM> To: P.Stephenson@swansea.ac.uk Cc: John.Cooper@Eng.Sun.COM (John S Cooper), Sam Falkner , zsh-users@math.gatech.edu (Zsh users list) Subject: Re: how can I skip globbing through SCCS subdirs? In-Reply-To: <26908.9511100853@pygmy.swan.ac.uk> References: <199511100311.TAA07019@kontiki.Eng.Sun.COM> <26908.9511100853@pygmy.swan.ac.uk> X-Attribution: JSC X-Mailer: VM 5.95 (beta) under 19.13 XEmacs Lucid Resent-Message-Id: <"J1hEH.0.Ji3.K8xem"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/128 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >> P Stephenson writes: Peter> This means you can exclude SCCS directories like this: Peter> ls **/*.c~(*/)#SCCS/* Peter> The (*/)# is a trick so that top level SCCS directories are Peter> ignored as well as any /SCCS/ bits in the middle somewhere. Marvellous! that seems to work great. This also seems to be equivalent: ls **/*.[ch]~**SCCS/* Interestingly, using `time' indicates that the form above spends less time in the system, but more time in user space. (I ran the experiment multiple times and the results below are pretty representative of a rough average) /bin/ls **/*.[ch]~**SCCS/*: 0.89s(r) 0.37s(u) 0.19s(s) (63%) /bin/ls **/*.[ch]~(/*)#SCCS/*: 0.99s(r) 0.15s(u) 0.28s(s) (43%) Should there be any performance difference between using **SCCS and (/*)#SCCS ? Is the exclusion pattern (to the right of the ~) evaluated once per file that matches the left hand side, or is it evaluated for everything, and then somehow merged with the output of the left side? Would it be more efficient to narrow the scope of the exclusion by using this?: ls **/*.[ch]~**SCCS/*.[ch] [ Again, please copy me on any replies, since I'm not on the alias ] Thanks, --- John.