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,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4443 invoked from network); 28 Mar 2023 20:35:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Mar 2023 20:35:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1680035712; b=jmZOn+iTuYipGeG7CgicOw1Aar2uIxTwYmacX1tqCLuOEuk+FqwQKE6f6qwfoPV0MMDkcsY1Cl 3cp/ex1s2kFocRT+fifHgiyYvSJaG8rKgoO1SsTicwHokDcceWkwT1bQ3ydB6m69+7z5MoUufJ 7ZUZ8v2DZp4TS2NBMVeuL4I15Vg+1iHlPRidJ7qFWRi8kuqqsEtAscMQ5LKB/q/ombL5lnPG/a H9Wfb4ILXjGUCwRmTY8ItJIWDXAOov47KO+BmdrVN1xZO/YxW/GnThPWeFOGBvIuX0i+GUfHN4 jLlzvDJReaEFhiPaYMsg9I1y8RSuskU/7GnTI0FiBejZrg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (101a.relay.hey.com) smtp.remote-ip=204.62.115.195; dkim=pass header.d=hey.com header.s=heymail header.a=rsa-sha256; dmarc=pass header.from=hey.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1680035712; bh=FGbZb8OIAv+1bu/ydQU7lOcdxqfAlgf6wSow7Ml4wB8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: In-Reply-To:Message-ID:Cc:To:From:Date:DKIM-Signature:DKIM-Signature; b=WEXSvtCYwBzf4br63bEFG8ZGPuJRvVQBbEl0wYIm9ttxBhbip6c+3oEZSWcE6yZ2NToRVcq492 3lIT4Dx+iLMIOLNjtDBPQBdODIcVKrGbhQgyM8cbMgw3N2a4wbd7nk7OpYAVI3YhwNX0Qq6Boi MWQtEwMxpt3tqyiiwhq7QiXsQgeR1QgeZQlJzhfxfEWliU4URVzWAKHjX6b+A/idC2gPrZkhCx GBQNcJFip6fgsO2FtuGksx3DtMEUC9dmKklkVFoAOnwioYrQ5HpztPZYIrNzxzZivnLLVKI0Qo BOk1/H4G83FIDiJOY0rA4TruA8HaW49bkJopNq7n1L/Bjg==; 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-Transfer-Encoding: Content-Type:Mime-Version:Subject:In-Reply-To:Message-ID:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:References; bh=NPWUsiqHAPwuFtByrD3lWq+Mu0wgo0DgVYI3iPcGAk8=; b=fLXAh8minpzGO9lnD9EgP6bag3 PCxFLdtGNvwGPyVo4vO/95sZxdVHDNHvue/mgDhd2knU0+titU/MOG6fmfZP/U9MjcM7OZh/r8cvp VqaprNU5riPltjjssN2S5/f1tN9V2y6jL3Y6wepQ4O7egv9g1ktZDf2glScLGWiwJH2uiHYgis4nk uA2rVUbM4E7rZ/TkeyBtTuP+lsDBWuJntQ3u6VLwXifuLllEP3EpBpOlzWKrhk39Xwgj/lS3R/Hbb 2rASXD5JVdAJGU6Ds0FbPm2RauDsFFmbj9JkmtXWMQuj24BRx25KezPv2Ltzj98SmnDK8sfeUIZl8 3NBdc0bw==; Received: by zero.zsh.org with local id 1phG2C-000Mj4-II; Tue, 28 Mar 2023 20:35:12 +0000 Authentication-Results: zsh.org; iprev=pass (101a.relay.hey.com) smtp.remote-ip=204.62.115.195; dkim=pass header.d=hey.com header.s=heymail header.a=rsa-sha256; dmarc=pass header.from=hey.com; arc=none Received: from 101a.relay.hey.com ([204.62.115.195]:34917) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1phG1Q-000M0b-SQ; Tue, 28 Mar 2023 20:34:26 +0000 Received: from hey.com (bigip-vip.rw-ash-int.37signals.com [10.20.0.24]) by 101.relay.hey.com (Postfix) with ESMTP id 6FDAAE0724; Tue, 28 Mar 2023 20:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hey.com; s=heymail; t=1680035663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=NPWUsiqHAPwuFtByrD3lWq+Mu0wgo0DgVYI3iPcGAk8=; b=GGyq/7AxmuSUWArVv+pRVrcTJrj42X8VYqh8rPqozR/ttnxk6QDKNVLg3P/40xWcBudvNx 3wArfym2mnO7Qv7bgqhn0yoFCXuUBGDvOZQQkdYrAk+X37IfWv3vaqzV9ONS9pucB8p6BV MA0c45xv0lNTg/nQubvn7+Puoaze0/2vUQ4V/YszbBdy++bQR4n/i0eLbZh0n59utObnyK gEfEViX0A7ww86z/Cx5HlryuEnNi6JhI51/olNhCJOrz2BSAFUXM0JdsuF4ClWz6my9d6R DlmD8sqPiKQL77PAY8MS7OCTtnpqrWd8/5sMraj/ddx36MDaEkoKIndqwD8d7A== Date: Tue, 28 Mar 2023 15:34:23 -0500 From: Eric Nielsen To: Bart Schaefer Cc: "zsh-users@zsh.org" Message-ID: <80675331828b603f64380626d518dffd875e5587@hey.com> In-Reply-To: Subject: Re: Assign to outer parameter from function called by zargs Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_64234f4f65013_44961db0251a3"; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Seq: 28994 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: ----==_mimepart_64234f4f65013_44961db0251a3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >> assign_outer runs in a subshell, so it cannot modify the parameters of >> the parent shell. > More specifically, there's this comment in zargs: > > # Everything has to be in a subshell so that we don't "wait" for any > # unrelated jobs of the parent shell. > > The "wait" is necessary to set the return status of zargs in (as > nearly as possible) the same way that xargs would do, so you can't run > current-shell actions with zargs. Thanks Roman and Bart for the explanation. Makes perfect sense. > What's the context of your question and your desired end result? My use case might be too specific: I wanted to somehow capture the end result of the processing of all the calls made by zargs. I didn't want to rely on the zargs return code when zargs is used with -P as it was missing values before Zsh 5.9 and it's intermittently failing in Zsh 5.9 and macOS. (https://www.zsh.org/mla/workers/2022/msg00611.html) So I though having the called functions assign a status code in an outer parameter could work. It was not a good idea...=C2=A0 :- ) -- Sent with HEY ----==_mimepart_64234f4f65013_44961db0251a3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>> assign_outer runs in a subshell, so it cannot modify the = parameters of
>> the parent shell.

> More specifically= , there's this comment in zargs:
>
> # Everything has to be i= n a subshell so that we don't "wait" for any
> # unrelate= d jobs of the parent shell.
>
> The "wait" is neces= sary to set the return status of zargs in (as
> nearly as possible)= the same way that xargs would do, so you can't run
> current-shell= actions with zargs.

Thanks Roman and Bart for the explanation. Ma= kes perfect sense.

> What's the context of your question and yo= ur desired end result?

My use case might be too specific: I wanted= to somehow capture the end
result of the processing of all the calls = made by zargs. I didn't want
to rely on the zargs return code when zar= gs is used with -P as it was
missing values before Zsh 5.9 and it's in= termittently failing in Zsh 5.9
and macOS. (https://www.zsh.org/mla/wo= rkers/2022/msg00611.html)
So I though having the called functions assi= gn a status code in an outer
parameter could work. It was not a good i= dea...=C2=A0 :- )


--
Sent with HEY
----==_mimepart_64234f4f65013_44961db0251a3--