[clue-tech] question on commands

Keith Hellman khellman at mcprogramming.com
Fri Mar 11 13:32:01 MST 2005


On Thu, Mar 10, 2005 at 07:38:04PM -0700, Timothy Klein wrote:
> On 10 Mar 2005, at 12:22 PM, Jed S. Baer wrote:
> 
> >On Thu, 10 Mar 2005 07:42:22 -0700
> >Dave Brown wrote:
> >
> >>find . -name application.properties | xargs vi
> >
> >Why pipe the find output through xargs when the -exec option is there 
> >in find?
> >
> 
> Not to speak for Dave Brown, but I would just guess out of habit.  Once 
> in a while, you have too many arguments for a single command line to 
> handle, in which case you need 'xargs' (or something like that).  So I 
> have met people that simply always used 'xargs' so as not to have to 
> remember two ways of doing it.

I think find calls -exec on *every* filename individually; which, if
your target application has a long startup (did someone say emacs? :^),
xargs does make a difference.

Another reason to use -exec on find is that it avoids weird effects when
you have spaces in filenames (yes, I know there are find & xarg option
combinations to mitigate this).  

Of course -exec requires all that escaping in your shell... 

Just my 2c.

-- 
Keith Hellman                             #include <disclaimer.h>
khellman at mcprogramming.com                from disclaimer import standard
public key @ www.mcprogramming.com

Before you critize someone, run a mile in their shoes. When you do
critize them, you'll be a mile away and you'll have their shoes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://cluedenver.org/pipermail/clue-tech/attachments/20050311/8c4eac82/attachment.bin


More information about the clue-tech mailing list