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).

Have a nice day,
Berny


Reply via email to