From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16352 invoked from network); 8 Dec 2003 18:14:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Dec 2003 18:14:55 -0000 Received: (qmail 26908 invoked by alias); 8 Dec 2003 18:14:36 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6852 Received: (qmail 26881 invoked from network); 8 Dec 2003 18:14:36 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 8 Dec 2003 18:14:36 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [35.9.66.29] by sunsite.dk (MessageWall 1.0.8) with SMTP; 8 Dec 2003 18:14:35 -0000 Received: from valentino.pa.msu.edu (localhost.localdomain [127.0.0.1]) by valentino.pa.msu.edu (8.12.8/8.12.8) with ESMTP id hB8IEYdB018879 for ; Mon, 8 Dec 2003 13:14:34 -0500 Received: (from juhas@localhost) by valentino.pa.msu.edu (8.12.8/8.12.8/Submit) id hB8IEYQ0018877 for zsh-users@sunsite.dk; Mon, 8 Dec 2003 13:14:34 -0500 X-Authentication-Warning: valentino.pa.msu.edu: juhas set sender to juhas@pa.msu.edu using -f Date: Mon, 8 Dec 2003 13:14:34 -0500 From: Pavol Juhas To: "Zsh Users' List" Subject: Re: Excluding files in CVS directories in filename generation Message-ID: <20031208181434.GA18785@pa.msu.edu> Mail-Followup-To: Zsh Users' List References: <10346.1070904549@csr.com> <87r7zffbz5.fsf@lynx.tre-1.ionific.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r7zffbz5.fsf@lynx.tre-1.ionific.com> User-Agent: Mutt/1.4.1i On Mon, Dec 08, 2003 at 07:36:30PM +0200, Hannu Koivisto wrote: > Peter Stephenson 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