Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strange glob expansion
- X-seq: zsh-users 2570
- From: Adam Spiers <adam@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: strange glob expansion
- Date: Sun, 5 Sep 1999 22:07:31 +0100
- In-reply-to: <199909030855.KAA163997@xxxxxxxxxxxx>; from Peter Stephenson on Fri, Sep 03, 1999 at 10:55:26AM +0200
- Mail-followup-to: zsh-users@xxxxxxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <990903043451.ZM25090@xxxxxxxxxxxxxxxxxxxxxxx> <199909030855.KAA163997@xxxxxxxxxxxx>
- Reply-to: Adam Spiers <adam@xxxxxxxxxx>
Peter Stephenson (pws@xxxxxx) wrote:
> "Bart Schaefer" wrote:
> > Adam Spiers <adam@xxxxxxxxxx> 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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author