That is the best expaination that I have ever seen of the find command.
Thanks!

-JAM

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Winston Jenks
Sent: Monday, September 25, 2000 1:10 PM
To: Foxboro DCS Mail List
Subject: Re: find command ussage?


Stan,
    Here is two more cents from someone without an I/A system (yet).  Part
of the mystery of the find command is that its arguments are divided into
two groups {starting-directories} and {matching-criteria-and-actions}.  The
tricky thing is that the actions can be mixed with the criteria.  This
leads to the following somewhat obfuscated example taken from my Unix
System Admin book.  Note the escaped parentheses to group conditions (I
just found out you could do that!)

find / \( -name a.out -o -name core \) -type f -exec rm -f {} \; -o -fstype
nfs -prune

FIND(find) A PLAIN FILE(-type f) WHOSE NAME IS EITHER a.out OR core (-name
a.out -o -name core) AND REMOVE IT (-exec rm -f {} \; )  OR (-o) IF THE
FILESYSTEM TYPE IS NFS (-fstype nfs) DONT BOTHER SEARCHING (-prune).

The trick is that the -prune is only applied to the part of the expression
after the top level OR.  In R. Swapp's earlier reply, the -prune needs to
be placed just where he has it, so that it only applies to the urfs
filesystem type.  I have a feeling that the earlier response you got from
Foxboro support is missing the -prune.  The book also describes another
System V action, -mount, to restrict the search to the filesystem of the
starting directory.  This option is -xdev on BSD systems.

I cannot check any of this on an I/A system, so I suppose it is therefore
all theoretical.
Winston Jenks
Technical Director, Cape Software, Inc.


-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All
postings from this list are the work of list subscribers and no warranty
is made or implied as to the accuracy of any information disseminated
through this medium. By subscribing to this list you agree to hold the
list sponsor(s) blameless for any and all mishaps which might occur due to
your application of information received from this mailing list.

To be removed from this list, send mail to
[EMAIL PROTECTED]
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]


-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]

Reply via email to