Problem with find(1)

Chris Torek chris at mimsy.UUCP
Fri Sep 23 07:55:59 AEST 1988


In article <108 at forsight.Jpl.Nasa.Gov> roston at 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 at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list