Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: strange glob expansion



Adam Spiers wrote:
> 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?

You could try generating all of them and exclude the wrong ones (with
extendedglob).  It's slower because it examines directories not
beginning with L (all of them), but it's a single pattern.  You can
stick in the ::'s at the same time.
  print **/*.pm~[^L]*(:gs./.::.)
I can't think of a better way of doing it as a single pattern.  With
the other way, you might want to put (N) at the end, although having
cshnullglob is a bit neater here.

By the way, does anyone want a globbing flag to turn on extended glob?
e.g. (#x)foo and (#X)foo would compile pattern foo with extended glob
on or off.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author