Path: utzoo!mnetor!uunet!nbires!ncar!oddjob!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.unix.questions
Subject: Re: 'find' - can i prune on the basis of pathnames?
Message-ID: <11426@mimsy.UUCP>
Date: 10 May 88 04:55:05 GMT
References: <435@stylus.cme-durer.ARPA>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 28
Keywords: find prune path versus filename question

In article <435@stylus.cme-durer.ARPA> klm@cme-durer.ARPA (Ken Manheimer)
writes:
>... The problem concerns pruning absolute paths from a directory-structure
>traversal. This is as opposed to pruning relative directory-names,
>which is easy to do using a '-name  -prune' clause.

It cannot be done directly.  You *can* do this:

  find  -exec expr {} = /foo/bar \| {} = /foo/baz \; -prune -o 

This will not perform  on /foo/bar and /foo/baz; if you want them
done, but not any files within them, try

  find  \( -exec expr  \; ! -prune \) -o 

>Is it in fact the case that find will not perform a prune on the basis
>of a (non-trivial) pathname...?

It is.  -prune simply says `do not search the current path any deeper',
and then succeeds a la -print.  (At least, that is what the one I put
in on our Vaxen does, and I did it from the Sun documentation.)

>... I know i could accomplish what i want using a post-filter ...

That would probably be fastest.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris