From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11216 invoked from network); 5 Sep 1999 21:08:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 5 Sep 1999 21:08:04 -0000 Received: (qmail 2922 invoked by alias); 5 Sep 1999 21:07:33 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2570 Received: (qmail 2915 invoked from network); 5 Sep 1999 21:07:32 -0000 Date: Sun, 5 Sep 1999 22:07:31 +0100 From: Adam Spiers To: zsh-users@sunsite.auc.dk Subject: Re: strange glob expansion Message-ID: <19990905220731.A7232@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh-users@sunsite.auc.dk References: <990903043451.ZM25090@candle.brasslantern.com> <199909030855.KAA163997@hydra.ifh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199909030855.KAA163997@hydra.ifh.de>; from Peter Stephenson on Fri, Sep 03, 1999 at 10:55:26AM +0200 Peter Stephenson (pws@ifh.de) wrote: > "Bart Schaefer" wrote: > > Adam Spiers wrote: > > } The upshot of this is that to match all Perl modules starting with `L' > > } below the cwd, I have to use L{*/**/*,}.pm instead of L**/*.pm. > > > > What? L{*/**/*,}.pm is first brace-expanded to L*/**/*.pm and L.pm, and > > then globbed. There probably isn't an L.pm, so that matches in any sub- > > directory whose name starts with L and all its subdirectories, all the > > files whose names end with .pm. You could have done that without the > > braces, with L*/**/*.pm, but I suspect what you meant was */**/L*.pm. > > I think the answer is **/L*.pm --- as remarked by someone a day or two ago, > **/ can match (very usefully, but slightly counterintuitively given the /) > in the current directory too. For example, in /usr/local/lib/perl5 > `ls **/A*.pm' gives me: > AnyDBM_File.pm AutoLoader.pm AutoSplit.pm Text/Abbrev.pm No, I was after all Perl modules starting with `L' in the sense that I would say that Text::Abbrev started with `T' rather than `A'. (I later replace all `/' in the result of the expansion with `::'.) So I did mean L**/*.pm, not **/L*.pm. However, as Bart rightly guessed, L{*/**/*,}.pm was a load of rubbish. I actually meant L*{/**/*,}.pm. Is there a better way of achieving this?