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 2296 invoked from network); 12 Oct 2021 08:20:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Oct 2021 08:20:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634026844; b=jfSvcAB14eOM1RGjDcFG72Oq/zkODBHtpJQ7YDaSDRhD4pVWghOjfTUPjJOoUjWEh6WKt0Njxl w5wlpRUDQEe4ZBOZ1on0kaFTL7Fd3KYkB0Vjcmho2Mng++waNgw9CCqv4BzTM995yHYqtMI746 I1pa747aO37osye905WALTKR5YhYjWmDg3BwX0NnolQop5XO69OwLtOixSKE7nIwBmPqZciDHy nxIAyZG3BbK1ipr7pkLFsTUIuHCBKQHLTVAXEnxH3VnjttkYrFE4X4ZKN7j2wcTTRr0dNDHreV sOqhqEBLU26oh2r9SwLJWX2RRFKbaFn8QlX61RJz+YgWGQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-40133.protonmail.ch) smtp.remote-ip=185.70.40.133; dkim=pass header.d=pm.me header.s=protonmail header.a=rsa-sha256; dmarc=pass header.from=pm.me; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1634026844; bh=vu8WhFO4nsmvhWomo04ZPm2KQ8NKyqaJxu+RkjLw8Vo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:Reply-To:From:To:DKIM-Signature:Date:DKIM-Signature; b=m16ceYDptlfqi+dsh3DmQ3bk3ntcSoVEOmAh6J5Zv4CE/BsiMoeNlr89zYWt8d5308uW5eAja2 EDfnW5A+JQ7GSal1mk4QJjz4m7y9g2ibVA/udL5D1wyrM2T/S6Q5Tk6F6h6TQtgcEIbHvxepu+ XOWCnESv3YgyvOHSxCA5tx5aODVdi64uV4FX52vr9uDybJiIdNID96S+4h44K+Fp/kmjG/40Q8 1iM3ki/JhXfvuhjyBA7fvPMgahP3Gy+Ln5mTJbYWjjMAhaq6Xx64tkEi8OHQJFsEb690aXIIon oW3KYqCbtKYn21i/2y/RSU5WPEV1TZqFObI9w65ntvlJLg==; 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:Message-ID:Subject:Reply-To:From:To:Date:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=vu8WhFO4nsmvhWomo04ZPm2KQ8NKyqaJxu+RkjLw8Vo=; b=LdIhcwXF4tot+Yqg2GHcIlSJfE IE64u/0yVsAhwIGqe8T6p1iz+VLGapmT9MaX9Z3yS/fNhwNF1p9MS2wJM9d0cEC4EVa7Nk8FMBx1c k+AOuttoCyO2CMeslsZGCtjIZTJwKKpi0mnp6WCVkzWMWx3/y0c3dSoX9CDTUpXr4DZKsG02moAbI C8zyKern8SKDHej914w8R8k0ksOKd8OlEtRFiOS5rbtQtvOKJ75YYOhkLTMlvplhBA4ZAwNYDi4r/ /kusdnUcwRWYSzipvuvphQ6+uKx2f1gFHjDQj0U0lyPncFnCBZzlWqhq9lYgHXTCzNGUgJO5/pE4/ kcsl/UHA==; Received: from authenticated user by zero.zsh.org with local id 1maD1d-0000xi-W0; Tue, 12 Oct 2021 08:20:42 +0000 Authentication-Results: zsh.org; iprev=pass (mail-40133.protonmail.ch) smtp.remote-ip=185.70.40.133; dkim=pass header.d=pm.me header.s=protonmail header.a=rsa-sha256; dmarc=pass header.from=pm.me; arc=none Received: from mail-40133.protonmail.ch ([185.70.40.133]:52889) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1maD15-0000fh-E3; Tue, 12 Oct 2021 08:20:08 +0000 Date: Tue, 12 Oct 2021 08:20:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1634026802; bh=vu8WhFO4nsmvhWomo04ZPm2KQ8NKyqaJxu+RkjLw8Vo=; h=Date:To:From:Reply-To:Subject:From; b=D8QvotUQeULkU3T9ZzJJ/y/7AOVG6+t/m7hQAeN9zAWHAN3/CQy8YHaXxQsTSACg5 X57wELOtCOjVbK1hrxHnnigcyXILdy26vKF5ZsSJb+qRpEAk8jTMduDch984gHvLi5 5UbBW92Dyji2cnHF34J56bFpt1ye6dKVfnITnczgPQHH68CC0deGvxgUy8N/lGZ4VL nbnvBUTHcsrlgIcCFn/HxHu532NDLEowLoqx+uoKNy9L10UMHOhdjA+s3islBD4w4v ihG2k+KvSz8aZSIjpton6lndLuxreRst1pCs+Ig8iYhDPTclbeyg6hHclPn0entSgi HRf7MJp3MdMng== To: "zsh-workers@zsh.org" From: Jett Husher Reply-To: Jett Husher Subject: Question on unintuitive behaviour for function execution and parameter assignment Message-ID: <78LG0jAMo3FtN941LSwAK1kIhfcF6dszDg8-71F1TxHB3vKubQBIIAWx8yujorTI1mEI8iq4Rsahakh7IfgcNXdq2KMviv805m0imzBh5Sk=@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 49471 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Good day! Does a function `assign-hello` treat parameter assignment on simple command= as local parameter in the following code snipped? ``` HELLO=3DWORLD function assign-hello() HELLO=3D$1 assign-hello THERE echo $HELLO # Prints 'THERE', as expected # This part trips me up HELLO=3D assign-hello WHY echo $HELLO # Why does it still print 'THERE'? ``` POSIX spec says that parameter assignment with function execution will alte= r the current shell environment and that it's not specified what's going to= happen with this parameter at the end of the execution. `zshmisc(1)` in FU= NCTIONS states that functions are called on a parent process, so my intuiti= on was that this sort of code should not work for them. Unfortunately, I co= uld not find any more information about this in the manuals or FAQs. Can manuals be updated to cover this behaviour, please? Thank you for your time. - Jett