On Fri, Nov 02, 2007 at 12:56:49AM +0100, A. Pagaltzis wrote:
> > On Thu, Nov 01, 2007 at 04:03:20PM -0700, Michael G Schwern wrote:
> > >   $ find . -print0 -name '*.txt' | xargs -0 rm
> 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.

This is what happened:

  find
    ok, I'm going to find something
  .
    in the current directory
  -print0
    I'll print its name (or exec rm, or ...)
  -name '*.txt'
    and see if it is called *.txt
  the end
    and then do nothing. i wonder why the user wanted to see what it's
    name was and then not do anything about it. <shrug>

Perhaps the confusion comes from the use of -blah for keywords in the
find mini-language instead of just a plain unadorned blah, which makes
it look like you're giving a load of options instead of a sequence of
instructions.  That it's a mini-language becomes obvious when you find
that there's AND, OR and NOT operators, (bracketing) for precedence, and
so on.

-- 
David Cantrell | A machine for turning tea into grumpiness

    Godliness is next to Englishness

Reply via email to