Problem with find(1)

Leo de Wit leo at philmds.UUCP
Fri Sep 23 23:38:53 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.  My current solution is to do
>    find / -name news -prune -o print ...
>which has the affect of skipping ALL directories named news, and
>all of their subdirectories.
>
>Does anyone have any ideas how I can simply skip news/spool?

Use the inode number of the directory instead of the name. This should be
unique. Assuming you use the Bourne shell:

    set `ls -di /news/spool`
    find / -inum $1 -prune -o -print ...

The find(1) here has no -prune option, but judging from your
description of it this should work.

        Leo.



More information about the Comp.unix.wizards mailing list