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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2299 invoked from network); 6 Nov 2021 22:57:07 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Nov 2021 22:57:07 -0000 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:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id: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=mFRIaP6mlIQB5I0Da2X9N6+/M1sBZ6fvkbRk+JqwsVk=; b=VQ0/UxNB34SXaSn07ytlPdHDUo JDYLfV4moFrlecDGDhkkLKQh3BDy0YtU07IBy2G7/JqYIQRXWQ3M6aIWsB+GAXp0j7ziW8ysOVZVk +d5p/0ELJvU0Ryld37H+ahuDVvuHPiEPhoG5JTce3jl7rlSTkXSUqM3yo/U5V6fA2hPjKj1GvNlwh C9TlAiuKEDwGlA/VMTCQpqwviG3t9fdrfbBtVD1wEna8yie2bu7UFqz4R6rFo/tZU9EuQphzSQAMx 7cqBb63At+V23otZN6JWxfsjKOsr095mPumUSFIBRJ6A3rJhk398nohYARiRGhfLdZEHo9jout7S4 h407aYXA==; Received: from authenticated user by zero.zsh.org with local id 1mjUcU-000K4w-O2; Sat, 06 Nov 2021 22:57:06 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mjUbd-000JNp-BV; Sat, 06 Nov 2021 22:56:13 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 8E4A327C0054; Sat, 6 Nov 2021 18:56:11 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute4.internal (MEProxy); Sat, 06 Nov 2021 18:56:11 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdelucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepnfgrfihrvghntggv pgggvghljoiiqhhuvgiiuceolhgrrhhrhihvseiishhhrdhorhhgqeenucggtffrrghtth gvrhhnpeeikeejveeludegfeeigfeulefggfdttdegheevvdehvdeigfehvdffuedvvdeu heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrg hrrhihvhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduhedukeejjedt gedqudduledvjeefkeehqdhlrghrrhihvheppeiishhhrdhorhhgsehfrghsthhmrghilh drtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2199721E006E; Sat, 6 Nov 2021 18:56:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1369-gd055fb5e7c-fm-20211018.002-gd055fb5e Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Sat, 06 Nov 2021 18:55:50 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Zach Riggle" , "Bart Schaefer" Cc: zsh-users@zsh.org Subject: Re: Efficient way to map a list of values to multiple processes, then accumulate their output Content-Type: text/plain X-Seq: 27321 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: 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