On Mon, Dec 03, 2018 at 08:16:22AM +0100, Bernhard Voelker wrote:
> On 11/30/18 12:14 PM, Roman Bolshakov wrote:
> > May I ask you to review what way we should go with ARG_MAX?
> > 
> > I'm okay with both ways whether it's:
> >  * computing effective argument length and passing it to "-s" option;
> >  * or exploiting behaviour of GNU/BSD xargs and specifying "-n" beyond
> >    the limit.
> 
> Actually, xargs (and any implementation of it) cares about the limit
> itself.  That's what it is made for.
> 
> You would limit the number of args with "-n" if the executed program
> can only handle up to that number, or if the logic requires it, e.g.
> when input comes in as pairs:
>   $ seq 6 | xargs -n2 echo diff -u
>   diff -u 1 2
>   diff -u 3 4
>   diff -u 5 6
> 
> There's no need to worry about the other end of the range.
> So in your patch, just omit the -n (and getconf).
> 

Hi Berny,

I like the approach. I was thinking of it while reading xargs manual but
forgot to write it down. Since we need to compute the limit only for
xargs we can omit it altogether.

Thank you,
Roman

Reply via email to