From owner-freebsd-questions Wed Mar 6 23:29:57 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp04.retemail.es (smtp04.iddeo.es [62.81.186.14]) by hub.freebsd.org (Postfix) with ESMTP id E708937B405 for ; Wed, 6 Mar 2002 23:29:50 -0800 (PST) Received: from conway.localdomain ([62.174.68.180]) by smtp04.retemail.es (InterMail vM.5.01.03.02 201-253-122-118-102-20010403) with SMTP id <20020307072949.EGCX1921.smtp04.retemail.es@conway.localdomain>; Thu, 7 Mar 2002 08:29:49 +0100 Date: Thu, 7 Mar 2002 08:32:40 +0100 From: F.Xavier Noria To: Bsd Neophyte Cc: freebsd-questions@freebsd.org Subject: Re: question about the 'find' command Message-Id: <20020307083240.2eaec696.fxn@retemail.es> In-Reply-To: <20020307020236.7623.qmail@web20110.mail.yahoo.com> References: <20020307020236.7623.qmail@web20110.mail.yahoo.com> X-Mailer: Sylpheed version 0.7.2 (GTK+ 1.2.10; i386--freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 6 Mar 2002 18:02:36 -0800 (PST) Bsd Neophyte wrote: : an example they give is the following: : : $ find ~ -name core -exec rm {} \; Besides the other answers, I would like to add that while that use of -exec is popular, it is doing the job as a side effect, since we discard the boolean value resulting from the execution of "rm". I mean, "find" provides boolean operators to filter its ouput, -name, -or, -newer, and -exec are examples. The unary -exec returns a boolean value according to the exit status of the executed command. That's why when I want to do something with the filenames resulting from running "find", I prefer to pass them to the actual command like this: $ find ~ -name core | xargs rm Just my philosophical 2 cents. -- fn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message