Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Efficient way to map a list of values to multiple processes, then accumulate their output
- X-seq: zsh-users 27321
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Zach Riggle" <zachriggle@xxxxxxxxx>, "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: Efficient way to map a list of values to multiple processes, then accumulate their output
- Date: Sat, 06 Nov 2021 18:55:50 -0400
- Archived-at: <https://zsh.org/users/27321>
- In-reply-to: <CAMP9c5=GjmYCbvwUOoj8HM6M2DFDOtf3m2_BpF2pqN+Fv6CWUw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5m90kMiV00A5mB3ANwFjUKZQsS2BScEJnXEmgA6rLwwyA@mail.gmail.com> <CAH+w=7Ymg=D1cjb2NRVUPXoNPzXxaNm=q1m-0P4dX_+yWUjPhw@mail.gmail.com> <CAMP9c5=GjmYCbvwUOoj8HM6M2DFDOtf3m2_BpF2pqN+Fv6CWUw@mail.gmail.com>
On Sat, Nov 6, 2021, at 5:58 PM, Zach Riggle wrote:
> A very simple test works exactly correct, but a slight variation gives
> me "zargs: argument list too long":
From your gist:
> # Works
> zargs -P12 -n1 -- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -- wrapper1
> # Does not work --> zrgs: argument list too long
> zargs -P12 -n1 -- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -- wrapper2 double
From zshcontrib(1):
zargs [ option ... -- ] [ input ... ] [ -- command [ arg ... ] ]
[...]
The options -i, -I, -l, -L, and -n differ slightly from their
usage in `xargs`. There are no input lines for `zargs` to
count, so -l and -L count through the "input" list, and -n
counts the number of arguments passed to each execution of
"command", *including* any "arg" list.
So you actually want -n2. (Adjust to taste.)
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author