From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26697 invoked from network); 8 Nov 2021 20:46:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Nov 2021 20:46:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636404399; b=iTmP0qglnuQ+zB0MG5pJnKiA6Dw0Cz0Sj/S131BFM56dZ/UzWYlpPI6v6tE8yddCB9mkacuupm +/hv0kc5MzXBehGxCeWNEYK7/X2ic0O++pLuJFZhnd7i3PXOupMd9Q5QMUC1umMf6bcUFLPjK4 hV6cfbgiI56yFux9cWh9/sMC+zM0qc4HOBBseBinjUPw2tNJPmGIXKWxiAb4P9kHiuFe+Xa6K5 gHu+dV2SAhDxCY32JKn1Lt4oDAuEIODT3KXlf0qfQAz4O2eJEwfJu2NA424By+wNHMIgwP8YPV 3aOFjHyLdzu0L+1F47lsEryLz+fxSle4B+T6Qa9HSDtWaw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f42.google.com) smtp.remote-ip=209.85.128.42; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1636404399; bh=l7RFTseHldW1s5sKqKFjBKY0o6H/3vX8ordrEydhzvc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=rXkAJdeJMi2Hg61AcEfpZ8lJfmi+WnbgJOSxlJGq4xmCrFEf97YH+Nqlto7Rw4DGUtuEssOUmZ OG3ZHVEf4zZkHIiETzbGTH4/ySTjTBP1VEQqm6j1LthcFVFRDP57ZKfG8wJH769eh37kPidiqy 3kV2m4fwkZOrx5LEh5qEPjxe+fj58PgNQsbEpEMyg5J/b3LxInC2wNN2bualSXpUo8AYyCQARe LUzIdRaVsJpZ4LH0WqpUs96DyeTvd4MzcW+KWx31hJOk1zK1BB4H1AfhQC5VEYQlxgulc1NmAz YQwX284f2iFWREbSrXLdb5W5xPyssgU3H9DzIvSTXDxJUg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=RHDPR1rDAxQ9WDQQgIK2wk6dCT/eR8ua99i+sXE4PDY=; b=KG+6fmYazE0dZbpX4HTQck4I2M WtfWlj4Favb9iQsGjb3gRuAJ93gJyWBonn2y0arw2mkAxOZKoU900drzq7jWcaNsXYeBCnuVlmVU2 +I4FAevYlOTbh8VOv4vXYfeQHzeToMgk+lN2hC+/CoRY6TMP1I5jhQ37D4AraE3Zzd0QhkiJ4UWPH xg5nxowVlEmOETOQ0AbFURHX25NTw5tLxZ2QrDj8JqEbFpuzevRyKa3YIqGf0uHUqJCIqmnhskWbn hyyOYUxxWhvryhXNpp0M56biK7ennwXGiwzC+aDV9uVp1E6nkRehJwwalAkbs8QV3/axnGrNZThGN lGtXRxXg==; Received: from authenticated user by zero.zsh.org with local id 1mkBXL-000Fq4-60; Mon, 08 Nov 2021 20:46:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f42.google.com) smtp.remote-ip=209.85.128.42; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f42.google.com ([209.85.128.42]:54240) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mkBWp-000F9b-UJ; Mon, 08 Nov 2021 20:46:08 +0000 Received: by mail-wm1-f42.google.com with SMTP id y196so14069293wmc.3; Mon, 08 Nov 2021 12:46:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RHDPR1rDAxQ9WDQQgIK2wk6dCT/eR8ua99i+sXE4PDY=; b=fikemEcTgmREGXIxkt4S/DljxCW0YlHiLrdjiPPhGHSEeUzZFSZU/9b2PKDup/kvfj leakQ4wZlEtBDz4YAonnkGYhS9tON7jS8/d+cvuOmW0tcxl53ckW3tffHK00xV27P1GQ 9CIv8GpWeZKMA3GQjsE682lDfHiml+6if6RWfy93dzKKxgF0OCnGhfDiOrJ4loKJ/9Z3 npYl+YFaz36yzxNCptl/Y8sz44hdUh3wrF7u91YpnDWMM96zA1Q/FT4xqzSJNcmw4iR1 m6+tenqR71UXks8OHqVOGOvLmWRhd8NrFbhrEIwfPEh/ypcyud50WNUJygHOtiChYhwt HnnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RHDPR1rDAxQ9WDQQgIK2wk6dCT/eR8ua99i+sXE4PDY=; b=5LiTnCGHXvFnS2yehSP6xdE8CHWk7N4CCBYegrw3w/CyFjC8K67e0GVfB8QZGq9mNS yaHNDFTINGiAS6c/0CRNs78lBJDqyFFQkG/sDHKxR7E0vCaBcoDtq5KY2D9gqjWuZTED inBOjUkCo9VLZUgJ9x1L5mUAWR5dbiVmZHvKCySnUwtJHj/hnsVDCirgP8JiPAt3frFR dopIUWiwu4daHYWbh6bisCM2MiNLURXt0DmaHB8X5iCk6SNNpAnGdZrBzyGhT59AK127 YiMyJnecMT7VqSIWSn0f5qlCep3mWmEsiQlZRzCF5Yl5rNEN5R8tWnQMEvwBYSk/5Vzi zQ7w== X-Gm-Message-State: AOAM531O9+YotYTdqt514uUj7dsrof/WCN/k14rH9sBW1uhli1jp7PmK dD/vipkE3r5qnLROWsN1UqN5NftQwvhq6QECwqlFU18zy3U= X-Google-Smtp-Source: ABdhPJz+v+IVvjdiEBGums59Clp5KJCfqGvyqX0rJUNKDKfKn4WP5utJdd9QtL0vzV/E22E2UwlBqpDqURUrBqeSdPA= X-Received: by 2002:a7b:ca4c:: with SMTP id m12mr1193757wml.119.1636404367223; Mon, 08 Nov 2021 12:46:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zach Riggle Date: Mon, 8 Nov 2021 14:45:56 -0600 Message-ID: Subject: Re: Efficient way to map a list of values to multiple processes, then accumulate their output To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: Bart Schaefer , Zsh Users Content-Type: multipart/alternative; boundary="00000000000004739705d04d154e" X-Seq: 27329 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --00000000000004739705d04d154e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable And after going to change my test script, I actually grokked what you were suggesting :) *Zach Riggle* On Mon, Nov 8, 2021 at 2:27 PM Zach Riggle wrote: > Ah-ha! Okay! I took "works exactly like xargs" a little too literally an= d > didn't read the docs closely enough. > > As always, thanks for your help guys! > > *Zach Riggle* > > > On Sat, Nov 6, 2021 at 5:56 PM Lawrence Vel=C3=A1zquez w= rote: > >> 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 >> > --00000000000004739705d04d154e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
And after going to change my test script, I actually grokk= ed what you were suggesting :)

Zach Riggle

=


On Mon, Nov 8, 2021 at 2:27 PM Zach Riggle <zachriggle@gmail.com> wrote:
Ah-h= a! Okay!=C2=A0 I took "works exactly like xargs" a little too lit= erally and didn't read the docs closely enough.

As a= lways, thanks for your help guys!

Zach Rigg= le



On Sat, Nov 6, 2021 at 5:56 PM= Lawrence Vel=C3=A1zquez <larryv@zsh.org> wrote:
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):

=C2=A0 =C2=A0 zargs [ option ... -- ] [ input ... ] [ -- command [ arg ... = ] ]

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [...]

=C2=A0 =C2=A0 =C2=A0 =C2=A0 The options -i, -I, -l, -L, and -n differ sligh= tly from their
=C2=A0 =C2=A0 =C2=A0 =C2=A0 usage in `xargs`.=C2=A0 There are no input line= s for `zargs` to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 count, so -l and -L count through the "inp= ut" list, and -n
=C2=A0 =C2=A0 =C2=A0 =C2=A0 counts the number of arguments passed to each e= xecution of
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "command", *including* any "arg&= quot; list.

So you actually want -n2.=C2=A0 (Adjust to taste.)

--
vq
--00000000000004739705d04d154e--