Subject: RE: find: missing argument to -exec
From: "Kevin Wright" <[email-masked]>
To: "Stein M. Eliassen" <[email-masked]>
Cc: "Cygwin-Mailing-List" <[email-masked]>
Date: Thu, 15 Mar 2001 15:15:46 -0800

Stein,

How about: 
$ find . -mtime 1 |xargs rm

from the find man page:

-exec command ;
       Execute command; true if 0 status is returned.  All
       following arguments to find are taken to  be  argu-
       ments  to  the command until an argument consisting
       of `;' is encountered.  The string `{}' is replaced
       by the current file name being processed everywhere
       it occurs in the arguments to the command, not just
       in arguments where it is alone, as in some versions
       of find.  Both of these constructions might need to
       be  escaped  (with a `\') or quoted to protect them
       from expansion by the shell.  The command  is  exe-
       cuted in the starting directory.

It seems that you need the \ next to the ; thus:

find . -mtime 1 -exec rm {} \;

At least that worked for me. YMMV

--Kevin

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Stein M. Eliassen
> Sent: Thursday, March 15, 2001 2:28 PM
> To: [email-masked]
> Subject: find: missing argument to -exec
> 
> 
> Hi,
> 
> When trying:
> find . -mtime 1 -exec rm {}\ ;
> 
> I'm receiving 'find: missing argument to -exec', I've tried 
> several variants
> too.
> 
> Even searched the archives and found some post's regarding the 
> subject, but I'm
> still not able to solve it.
> 
> Someone knows what's the problem here?
> 
> On another note, it's something wrong with my cygwin-setup since the 'alt
> gr'-key doesn't work in the cygwin-shell, but everything is correct from
> cmd.exe.
> 
> How do I handle that?
> 
> Cygwin version installed is 1.1.8 on NT4 SP6.
> 
> 
> Regards
> Stein
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
> 
> 

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple