This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: -exec on find(1) broken


On 09 October 2007 08:07, 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.

  Will break on paths/files with embedded spaces, use 

find . -type f -mtime +18 -exec /bin/echo '"{}"' \; | more

  Also if you're going to turn it into an rm, I'd generally do it in two
steps:

find . -type f -mtime +18 -exec /bin/echo rm '"{}"' \; > script.sh
(read script.sh in editor and make sure it's right!)
. ./script.sh

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]