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 24557 invoked from network); 8 Nov 2021 20:28:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Nov 2021 20:28:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636403304; b=VdMyPJXBlNmcbZyI2Uy7nXVlAppFwRqSkEpyhEG0M2GZ7M6DxjdUxyxb7PFhPVpZXR4DhnjuNR ftWeuzloLgP6N29eDOEQXMIP5Hj4c81gPOMs/rxk3fKxcnxf3i0FoBE1PxprcSShXLKwvwQhL3 5s7WUAeLTB6rUB/9MuEO8VeSdn2IFP6AF5gJYncl8xFxDc/Jox8AA0pTqb3ExanX4A68r5IXJ0 EYl57cn/N2UQ+n6BZSMrYwN+Tm3FSEFGSiMCgHvywyxRZZRYG69KO5y+lkRFzxUsjou+pUwP1E XjlISdSOqy7CKiVNPkgo5i0fVeHDSaPzkMBXwyVzsodd2g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f48.google.com) smtp.remote-ip=209.85.221.48; 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=1636403304; bh=psCtCnRD9NQvtJH9eSAvSZLjBlN6TGr6eNcYtwHfm2E=; 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=jFHTnCVoulnWGu2NZZW/CGoHllta1zQG7oxg0kwRg/B1q6Uqr1fUSUvkCFdJ7I54yeebuuR0N1 QR6sRvnyKJIYS1LJfX1RUHgZCXJtbL06bLgGpl+FiN+jIasb8CXNRtam+a19GqEvch0QloGC9K rttVCAe1PZ3EVzZ8S/YJTCzb3UrUU+M5H6uknEJCuXUcSnyb5g0hNkAZEE4Dn+WBjDsARAHHQd nu706q6H9ah3BHEIm0BEnxEO3ibnQWkQV8JZ1YjCbhjuj/MANadTi/EOmxGLuYiU4GHVEuhOtX nremo6sNRcJHuxcQm1mULCSTJq5Dn90J2UOFVHuUbO/Edw==; 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=JjnXfsMq3MEB4bIgiyT/xaUG7kdwJSrufcmlOWptQh8=; b=TRZyODwQHqL2da23a9ntRzUaF3 y26BBa7zr03M3u2NFVr1vHIF5QW99Vf070u8nyUYTEzMXz5zudAZrJ5gS7sB5cAtG9b11Hld3ztAu Kf7SnXOxyhpgVaOSiHndOqVb9odqcsZSWp2LmN5rL1tMXEeEnrXYyKv9ws2RCeedQF9wkbblJJJOG ZujINJSKoiHhDLQVsq9kY6zS9KtBdmIGZ+/wkuezt1mQAMjWQ3Dkaqlq7bUQh0mf7fop4O4tATRrI Zqem7HiZHrUzyHyNJqKlYJ4WZUzykulQNrZ6QIsvaTrxNGicFL9G/loc6DWfRmmrQVbcwO49egb9X VAD0Vi1Q==; Received: from authenticated user by zero.zsh.org with local id 1mkBFe-000EH8-DR; Mon, 08 Nov 2021 20:28:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f48.google.com) smtp.remote-ip=209.85.221.48; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f48.google.com ([209.85.221.48]:39466) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mkBEn-000DbM-17; Mon, 08 Nov 2021 20:27:29 +0000 Received: by mail-wr1-f48.google.com with SMTP id d27so29062849wrb.6; Mon, 08 Nov 2021 12:27:28 -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=JjnXfsMq3MEB4bIgiyT/xaUG7kdwJSrufcmlOWptQh8=; b=PK1ICRe3vJKzqNvSCdJLr5huu0FcdD2aRQ1kKuxs+Fhwh7V/xL+LtfcBeWZkZ9gsMc 4PLhjovAK1eGM1rfn2EGViP99nAQB9ub/4m7BVuCX/jDQgJZdHWtIWk33HTu/6bamekd 7ZzFtKxBReEFRwLpvRr24T4g/hZagJ6FM3hkUekzfkQEGxHKvJXwseQWv9LXzafB7m+i siTY7CsAQYAfHzLiS8QdkE9nOsfncUe1vjvEBYsmrB2jA8OQQlfVH1WGKl+8zeMAzKS1 E4fGcLXl598BAtp2tp6efBRyAN7aYzGYoYpJtbKKQvtZJJFRpyRbfTKt2PgvpflNyjtz 6oUw== 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=JjnXfsMq3MEB4bIgiyT/xaUG7kdwJSrufcmlOWptQh8=; b=jwex8NaoMAm8YDksH5zUYTBCkENZos5IKa6WqpOQ1ZLp80XZWSuoxM/9DAatzo9j3O 5R5IKZpDjXq4NDVyLB/xSUZBWXTx8x3zSGcDzCss7VuiV0OPPKlEUeYgdLJuwvVXI+pB ed436ZvUOHz7Oj/bolF2gVp/7vr5Ch1c4x6aWKGX6nR5vQ/MX1ZXtenoicUNp9UcfZEt 79g/d5rhjwYEpf1AUo2238+QRBeAelyFQQ+xp1v19eNhD1Vto7xd8ioyQJdyhHBslsLI H09x4kVttMneoF6NeCG8CLt5FqQ/4+NzLwFKuugFzgkBwkoUngHxWvWNBhYWzGAL4I5a +jmg== X-Gm-Message-State: AOAM530XzJwzeUJQPiVfTT/b82CCtTemlD27zqWIbDPCAC6q5WDIiASO 49L4/lvo5TbSZhDGETntwvypdmjaKOCcQQhap1kgPaUgSkc= X-Google-Smtp-Source: ABdhPJzTXiq+XGewVRzVZxeb+8Y3AeonnkEHc3etPUUlsImXNKIp/q2FY2HE1CR4ndtwiBIlhroe7PZepEqotwYGrxg= X-Received: by 2002:a5d:64ea:: with SMTP id g10mr2356043wri.137.1636403248092; Mon, 08 Nov 2021 12:27:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zach Riggle Date: Mon, 8 Nov 2021 14:27:17 -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="0000000000004fdacd05d04cd2b9" X-Seq: 27328 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: --0000000000004fdacd05d04cd2b9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah-ha! Okay! I took "works exactly like xargs" a little too literally and 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 wro= te: > 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 > --0000000000004fdacd05d04cd2b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah-ha! Okay!=C2=A0 I took "works exactly like xargs&q= uot; a little too literally and didn't read the docs closely enough.
As always, thanks for your help guys!

Za= ch Riggle



On Sat, Nov 6, 2021 at = 5:56 PM Lawrence Vel=C3=A1zquez <larry= v@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
--0000000000004fdacd05d04cd2b9--