[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] maint.mk: Split long argument lists
From: |
Bernhard Voelker |
Subject: |
Re: [PATCH 1/2] maint.mk: Split long argument lists |
Date: |
Mon, 3 Dec 2018 08:16:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
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