public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin@cygwin.com
Subject: Re: Editors set x-bit (sometimes)
Date: Wed, 14 Dec 2016 18:23:00 -0000	[thread overview]
Message-ID: <87zijyid58.fsf@Rainer.invalid> (raw)
In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A704BBD4197@USA7109MB022.na.xerox.net>	(Kenneth Nellis's message of "Wed, 14 Dec 2016 13:37:47 +0000")

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

  parent reply	other threads:[~2016-12-14 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 10:39 Ronald Fischer
2016-12-13 13:54 ` Ken Brown
2016-12-13 15:20   ` Ronald Otto Valentin Fischer
2016-12-13 19:03     ` Brian Inglis
2016-12-13 19:47       ` Achim Gratz
2016-12-13 20:15         ` Henry S. Thompson
2016-12-14 13:37         ` Nellis, Kenneth
2016-12-14 17:35           ` Andrey Repin
2016-12-14 18:23           ` Achim Gratz [this message]
2016-12-14 20:28             ` Nellis, Kenneth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zijyid58.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).