home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Consistency (was Re: is "xargs" really still useful just for limiting command line size?)

  • Subject: Re: [OCLUG-Tech] Consistency (was Re: is "xargs" really still useful just for limiting command line size?)
  • From: Richard Guy Briggs <rgb [ at ] tricolour [ dot ] ca>
  • Date: Fri, 16 Mar 2018 10:53:03 -0400
On 2018-03-16 10:31, Dianne Skoll wrote:
> On Fri, 16 Mar 2018 10:26:36 -0400
> Shawn H Corey <shawnhcorey [ at ] gmail [ dot ] com> wrote:
> 
> > git ls-files -z | xargs -0 grep 'function_name'
> 
> > The -z separates the names with a ASCII NUL and the -0 (minus zero)
> > allows xarg to read them correctly. This is useful if the files have
> > spaces in their names.
> 
> Thank you, Git developers. :(
> 
> "find" uses -print0.  "xargs" uses -0.  So of *course* git-ls-files uses
> -z.  (And -0 isn't already being used for something else.)

And of course git grep -l has no such option...

> Gaaaah.
> 
> Regards,
> 
> Dianne.

	slainte mhath, RGB

--
Richard Guy Briggs               --  ~\    -- ~\             <hpv.tricolour.ca>
<www.TriColour.ca>                 --  \___   o \@      @        Ride yer bike!
Ottawa, ON, CANADA                  --  Lo_>__M__\\/\%__\\/\%
Vote! -- <greenparty.ca>_____GTVS6#790__(*)__(*)________(*)(*)_________________