Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uflorida!haven!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.unix.wizards
Subject: Re: Problem with find(1)
Message-ID: <13699@mimsy.UUCP>
Date: 22 Sep 88 21:55:59 GMT
References: <108@forsight.Jpl.Nasa.Gov>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 18

In article <108@forsight.Jpl.Nasa.Gov> roston@robotics.jpl.nasa.gov
(Gerry Roston) writes:
>Ideally, I want to do the following:
>    find / -name news/spool -prune -o print ...
>however, this does not work.

`find' only looks at one component of the path name at a time, so
there is no way to exclude a particular sub-path directly.  You could
use

	-exec expr {} : '.*/spool/news$' \;

or some variant.  Alas, this requires one fork()/exec() per file name
traversed.  You could try to reduce the cost by running this only on
`likely' candidates (-type d -name news, for instance).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris