Undocumented find option

Undocumented find option

Post by Darren Dunha » Tue, 24 Oct 2000 04:00:00



Back in the thread "Need a good one liner", one person had a post about
an undocumented option to find.  This option allowed you to use the
-exec {} thing as normal, but would 'group' the execs much the same way
that xargs tries to do.

I tried it and it worked fine.  Now I can't find where I've recorded
that fact.  I've searched through deja on the thread (all 118 posts) and
can't find the post that my brain tells me exists.

Does anyone know what on earth I'm talking about?

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
      < Please move on, ...nothing to see here,  please disperse >

 
 
 

Undocumented find option

Post by Richard L. Hamilt » Wed, 25 Oct 2000 17:17:19




Quote:> Back in the thread "Need a good one liner", one person had a post about
> an undocumented option to find.  This option allowed you to use the
> -exec {} thing as normal, but would 'group' the execs much the same way
> that xargs tries to do.

> I tried it and it worked fine.  Now I can't find where I've recorded
> that fact.  I've searched through deja on the thread (all 118 posts) and
> can't find the post that my brain tells me exists.

> Does anyone know what on earth I'm talking about?

If you can't find it again (or don't want to depend on something
undocumented, which could after all go away with the next patch, let
alone the next release), get the GNU versions of "find" and "xargs";
they have special options that let one handle filenames with characters
in them that would *standard xargs.  Example:

   /opt/gnu/bin/find /path ... -print0 | /opt/gnu/bin/xargs -0 command args

--
ftp> get |fortune
377 I/O error: smart remark generator failed

Bogonics: the primary language inside the Beltway



 
 
 

Undocumented find option

Post by Tony Walto » Wed, 25 Oct 2000 04:00:00



> Back in the thread "Need a good one liner", one person had a post about

That was me, that was.

Quote:> an undocumented option to find.  This option allowed you to use the
> -exec {} thing as normal, but would 'group' the execs much the same way
> that xargs tries to do.

> I tried it and it worked fine.  Now I can't find where I've recorded
> that fact.  I've searched through deja on the thread (all 118 posts) and
> can't find the post that my brain tells me exists.

After a find .. -exec construction, use + instead of \; as the
terminator.

find foo -type f -exec boz {} +

Find will then batch up arguments to the command to be exec-ed instead
of exec-ing the command once for each argument.

Quote:

> Does anyone know what on earth I'm talking about?

I think that's what you meant...

Cheers

Tony

 
 
 

Undocumented find option

Post by Darren Dunha » Wed, 25 Oct 2000 04:00:00



> After a find .. -exec construction, use + instead of \; as the
> terminator.
> find foo -type f -exec boz {} +

Gracias.

I've saved it in the right place this time.  :-)

That also explains why doing a 'strings' on the binary didn't find it.
I had misremembered it as a different -flag.
--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
      < Please move on, ...nothing to see here,  please disperse >

 
 
 

Undocumented find option

Post by Thomas Tornblo » Thu, 26 Oct 2000 04:00:00




> > Back in the thread "Need a good one liner", one person had a post about

> That was me, that was.

> > an undocumented option to find.  This option allowed you to use the
> > -exec {} thing as normal, but would 'group' the execs much the same way
> > that xargs tries to do.

> > I tried it and it worked fine.  Now I can't find where I've recorded
> > that fact.  I've searched through deja on the thread (all 118 posts) and
> > can't find the post that my brain tells me exists.

> After a find .. -exec construction, use + instead of \; as the
> terminator.

> find foo -type f -exec boz {} +

> Find will then batch up arguments to the command to be exec-ed instead
> of exec-ing the command once for each argument.

> > Does anyone know what on earth I'm talking about?

> I think that's what you meant...

> Cheers

> Tony

I have filed an EOU to have this feature documented in the man page.

Thomas