Venkatesan Jeevanandam wrote:
> Bob Proulx wrote:
> >   find . -name "*.soc" -exec grep PATTERN {} +
>
> I used the command the way you specified, but I am getting the below error.
> /tools/oss/packages/x86_64-rhel4/findutils/default/bin/find: missing argument 
> to `-exec'

Hmm...  That find is perhaps too old to support the "{} +" syntax.  I
don't remember about RHEL4.  The "{} +" is the new and improved and
now POSIX standard best way.  But relatively new.  Older find commands
won't work.  Please try the older syntax.

  find . -name "*.soc" -exec grep PATTERN {} \;

The difference between "{} +" and "{} ;" can be found in the man
page.  Basically "{} +" is more efficient.  (And doesn't need the
semicolon escaped from the shell.)  It is equivalent to this:

  find . -name "*.soc" -print0 | xargs -r0 grep PATTERN /dev/null

But neither find -print0 nor xargs -0 were standardized and are GNU
extensions.

Seeing /tools/oss/packages/x86_64-rhel4/findutils/default/bin I have
to comment that it is a very strange thing to see in the path.

Bob


Reply via email to