This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: Editors set x-bit (sometimes)


Nellis, Kenneth writes:
> Really? I always thought the opposite. With -exec, doesn't
> find invoke the command for each single found object? While xargs 
> allows a single command to operate on a whole slew of objects.

I said "-exec +", although I concur it was too easy to miss.

> For example:
> find ... -exec pgm {} \;

Try replacing the "\;" with "+", depending on whether pgm can deal with
multiple arguments.

> executes pgm separately for each found object while
> find ... | xargs pgm
> invokes pgm only once for as many files as will fit on the 
> command line, which is quite a few.

Which is what

find ... -exec pgm {} +

will do, without piping the data to xarg and without you having to
remember that you really, really wanted to say

find … -print0 | xargs -0 pgm

unless you already know that there are no spaces or funny characters
anywhere in your filenames.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      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]