On Fri, 2 Nov 2007 00:56:49 +0100, "A. Pagaltzis" <pagalt...@gmx.de> wrote:

> * Michael Jinks <mji...@uchicago.edu> [2007-11-02 00:30]:
> > On Thu, Nov 01, 2007 at 04:03:20PM -0700, Michael G Schwern wrote:
> > > 
> > >   $ find . -print0 -name '*.txt' | xargs -0 rm
> > 
> > I hates xargs.  It has its place I guess, but this ain't it,
> > and souping up GNU find to (try to, sometimes) feed nice path
> > names to xargs seems only to have made GNU find that much more
> > hateful.
> > 
> > Since I learned how to make -exec do my bidding, I think I can
> > count on one hand the number of times I've had to hate xargs.
> 
> Except that's a red herring, because if he had but `-exec rm \;`
> where he put his `-print0`, the exact same thing would have
> happened.

Would it? Is {} the default arg somehow?

find . -exec rm {} \; -name '*.txt'
                ^^

would have given you at least loads of errors about the directories
that cannot be removed with rm :)

-- 
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/

Reply via email to