This is the mail archive of the cygwin@cygwin.com 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]

RE: find: missing argument to -exec


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: cygwin-owner@sources.redhat.com
> [mailto:cygwin-owner@sources.redhat.com]On Behalf Of Stein M. Eliassen
> Sent: Thursday, March 15, 2001 2:28 PM
> To: cygwin@cygwin.com
> 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


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