zsh-users
 help / color / mirror / code / Atom feed
From: P.Stephenson@swansea.ac.uk
To: John.Cooper@eng.sun.com (John S Cooper)
Cc: zsh-users@math.gatech.edu (Zsh users list)
Subject: Re: how can I skip globbing through SCCS subdirs?
Date: Fri, 10 Nov 95 08:53:43 +0000	[thread overview]
Message-ID: <26908.9511100853@pygmy.swan.ac.uk> (raw)
In-Reply-To: "John.Cooper@eng.sun.com"'s message of "Thu, 09 Nov 95 19:11:44 PST."             <199511100311.TAA07019@kontiki.Eng.Sun.COM>

John.Cooper@eng.sun.com wrote:
> I'm using extendedglob.  How can I match all .c files in all
> subdirectories, _except_ any SCCS subdirectories?
> 
> ls **~SCCS/*.c

The bad news is that ** handling bypasses most of the pattern code,
i.e. you can't actually exclude things while the ** list is being
expanded.  The good news is that in the ~ part of the pattern, /'s are
not special.  This means you can exclude SCCS directories like this:

ls **/*.c~(*/)#SCCS/*

The (*/)# is a trick so that top level SCCS directories are ignored as
well as any /SCCS/ bits in the middle somewhere.

By the way, as this shows, ~ has lower precedence than /.  That's
because it was originally intended that you only use ~ the way I've
just done, i.e. with the whole pattern.  However, you can now group it
using parentheses if you avoid using ** inside the parentheses (so it
doesn't solve your problem here).

> Ps. Is there a newsgroup for this alias?

No, sorry.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


       reply	other threads:[~1995-11-10  9:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199511100311.TAA07019@kontiki.Eng.Sun.COM>
1995-11-10  8:53 ` P.Stephenson [this message]
1995-11-10 19:09   ` John S Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26908.9511100853@pygmy.swan.ac.uk \
    --to=p.stephenson@swansea.ac.uk \
    --cc=John.Cooper@eng.sun.com \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).