X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <470B4F1B.3AD3BCB8@dessent.net>
Date: Tue, 09 Oct 2007 02:51:23 -0700
From: Brian Dessent <brian@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: -exec on find(1) broken
References: <470B1B1B.2060404@columbus.rr.com> <20071009062547.GA19172@suncomp1.spk.agilent.com> <470B22FF.10107@columbus.rr.com> <470B288E.8060504@columbus.rr.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Paul McFerrin wrote:

> Well, I finally got it!
> 
>      find . -type f -mtime +18 -exec /bin/echo {} \; | more
> 
> is the correct syntax.  Now I just replace "/bin/echo" with "/bin/rm"
> and I ready to go.

That's still horribly overcomplicated and inefficient.  Use "find .
-type f -mtime +18" to see what the results would be and "find . -type f
-mtime +18 -delete" to delete them.  It's much more efficient to let
find do the deleting than worrying about creating a bunch of echo or rm
child processes.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

