This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Editors set x-bit (sometimes)
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: "Nellis, Kenneth" <Kenneth dot Nellis at xerox dot com>, cygwin at cygwin dot com
- Date: Wed, 14 Dec 2016 20:25:49 +0300
- Subject: Re: Editors set x-bit (sometimes)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.ru
- References: <87h967obmc.fsf@Rainer.invalid> <0D835E9B9CD07F40A48423F80D3B5A704BBD4197@USA7109MB022.na.xerox.net>
- Reply-to: cygwin at cygwin dot com
Greetings, Nellis, Kenneth!
>> From: Achim Gratz
>> .. the latter is slightly less efficient and you have to
>> do -print0/-0, but I tend to get it right more easily then the -exec
>> stuff.
> Really? I always thought the opposite. With -exec, doesn't
> find invoke the command for each single found object?
Depends, how do you set the find, and what the net effect you wan to achieve.
> While xargs allows a single command to operate on a whole slew of objects.
Which boils down to executing command every time for each argument.
> For example:
> find ... -exec pgm {} \;
> executes pgm separately for each found object
What about
find ... -exec pgm '{}' +
?
> while
> find ... | xargs pgm
> invokes pgm only once for as many files as will fit on the
> command line, which is quite a few.
> If I'm wrong about this, please share.
It really depends on what you are doing with find.
find . -iname *.php -execdir grep -qP '(?<=function )funcname' '{}' \; -print
is one thing, but
find . -date +7 -exec mv -t /dir '{}' +
is completely another.
> Or, perhaps we are talking about commands that only take
> a single object. In that case, you would need to say
> xargs -n1
> in which case, I agree, it is less efficient.
--
With best regards,
Andrey Repin
Wednesday, December 14, 2016 20:13:08
Sorry for my terrible english...
--
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