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 848 invoked from network); 18 Jan 2021 16:34:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Jan 2021 16:34:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1610987686; b=YrEhD7FcP500tu5wnyPtbMkApDv4kfX+OTYgT/e+s40XUC7jQvBgv2Fci5g8v0gL4YDpaP32yw wi5ND7TAeWSvQf4Ys8Bs8iyGm52qx98zHrAN0vHdsIuwz0uV4jFD6Ft+IykDuzSUsqovVoTSd9 184p8/nqT72duPWPvgd/9SVe+PlvyrAkQK4Nj+MZQgvNR3w1AUuII+oDWRMXIarB8hbFxatvfa 2/GGxaqQfbD7JaQZPYIot4t/wi8jBNqYIHAAawbLP6qCPZwmMGl9E3dCfH7BLGkwHB52jNteGV +6X6bGyfYSWvxYDH/zeH6mTgqtNTH1BxBm50lspT10SCGQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1610987686; bh=y/D0NKzdnPf8vJPKziAY2Ay+9loUlOUYc+S/pSNTC0c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=IZj1Id5q3iJOwWGQy1QtSTCbWULtdzIxlNb8k/xJ3M1g09GxhBIUj+ORA0uTF0fv0Pi4jfFPse GE9VN4ByM9uSan+FlE36pqhNrRcgtOuCf5dcKUvwxcOgEgR/3Vq2WgdSaDhWQ6tnBtnmcqSshw bw5OB2TES3YAaDUDfCmcXTvUOFkYvW0aHn2mjcgynHJ6cbLqQ57phE58TAOo3ThErGPgSQrujB Rs8bJ4g6bPPBQdt8h23BGvvxZexHYklXaitPxupvANN6FgtnRXoWbYHUpen2XiMO8Ph4Gh2UVu XSCpn98dtNJRj3xr8h2D12Cb/6CSlJJBIdjuJlrQopXIeQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=jSwYN+a08VsSIkDoAW79vmZ2/xCjTGjUYH9QyU1Ske0=; b=wmmta0x9eQcHCuvLZ6v76ZHxZU OIWjFHhsBolOFyuWI2BR9Z1R6S5CZYSOTz6dgnY0GZoOkU3CqZ6tuQxAqPCDIdbu4PYC8rgXwaTN0 qqfCF0pwhasarH1HbCZIckSny5d5t7xAhJaqwF0449RKbuA8wld3f334EjwxfnpBRxf9riZJ9Sl7E bslbcH+lGgV6GP7BV7LXRSFzvKbBwkpPT8RWT7xXj1+RaxaZYlurS7HOqPl01GwTJzOG55HNkEW0t 18/nxXlcsEZzaM6AZ8WgHzjjvdYeBEE/lpfoGfZt2PUoN6bFGD6buP0mETqsDMkMd+st8x7iwDKbc xmSZATSw==; Received: from authenticated user by zero.zsh.org with local id 1l1XUJ-000DsK-M3; Mon, 18 Jan 2021 16:34:43 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:42990) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1l1XU0-000DkN-FN; Mon, 18 Jan 2021 16:34:25 +0000 Received: from [212.54.57.82] (helo=smtp3.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1l1XU0-0004YG-4G for zsh-workers@zsh.org; Mon, 18 Jan 2021 17:34:24 +0100 Received: from oxbe20.tb.ukmail.iss.as9143.net ([172.25.160.151]) by smtp3.tb.ukmail.iss.as9143.net with ESMTP id 1XU0l2thVugL81XU0l0lqq; Mon, 18 Jan 2021 17:34:24 +0100 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.151 X-CNFS-Analysis: v=2.4 cv=K9PnowaI c=1 sm=1 tr=0 ts=6005b890 a=Ip+kZtMD4PYul4iMASbA3A==:117 a=DeGUKtW0en8A:10 a=IkcTkHD0fZMA:10 a=zAZwVUNnDPoA:10 a=3-4-3kifAAAA:8 a=nlWbVhLu67eaIiuyKHIA:9 a=QEXdDO2ut3YA:10 a=kVGJNOa5ZtfYKEGBuSU1:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1610987664; bh=y/D0NKzdnPf8vJPKziAY2Ay+9loUlOUYc+S/pSNTC0c=; h=Date:From:To:In-Reply-To:References:Subject; b=LevLZz8Uhcu4H1RKOmnAZb3/ClCpPAaI/hlrSeNG2UFCGN0mWyppnWFknn7utlgyF pup/Bl4X50UqA7Dc/M6hIsee1bxQpGgDzZsKgN0vOFr7jMGMo+4JnggKzDGv5jF8B6 xjnymuyt9At3aM33JFf5ud43yE3+kqFJfS2qct70xa6zS7i0sq3GXc34Ne7tZplqes 1e2fWJsqGRceL5/UuJ/5EUZXOMjRhP/xtbvYLV0xSrqXJmA/WQ/Som/nc77z8rmjIt nRJvjeqeuNDLIZaWzpRn5ga8t32ACz4CZasckfGpwGzFy0958/ZmD+EGBXdiVJBpXk L8iNUGTn3Fpfw== Date: Mon, 18 Jan 2021 16:34:23 +0000 (GMT) From: Peter Stephenson To: Patrick Reader , zsh-workers@zsh.org Message-ID: <1219668732.3070481.1610987664058@mail2.virginmedia.com> In-Reply-To: <0102017716203d60-ea3cd78f-867c-4f6e-b37b-583ccdb44c13-000000@eu-west-1.amazonses.com> References: <0102017716203d60-ea3cd78f-867c-4f6e-b37b-583ccdb44c13-000000@eu-west-1.amazonses.com> Subject: Re: Bug with assignments in some commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.81.25 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfCAv8JxizBkXxrqQC1G/nJOHJLkq6ZgyCkt8EbH/PWA2RcedVSqpJTxMlta7VKu50sIq14p9XhdJ4yi3bsOzUOIYHep/2mjTR6MKVzSucQXOOOSylCYk 5zc7y8RcMIPC+HN3EMInpfMD1I4uujjDkKYZWKNx7lNNN0rdLsdErotm28Q6NhPZsbKVCWB8F9SsnTDMW2Q9OCAcb8RXdlxDLaHim9JQh6+faLSobT96vKl+ QDEHms7LTSEe/vR7slg6AQ== X-Seq: 47845 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: Archived-At: > On 18 January 2021 at 15:32 Patrick Reader wrote: > I believe I have found a bug: in arithmetic $(( )) or $[ ] and variable > expansions ${ } in some forms of command (pipelines, command > substitutions, and inside here-documents and here-strings are the cases > I know of so far), assignments to variables do not persist outside the > command, almost as if it were in a subshell. They *are* in a subshell. That's just how the shell works. The only difference between zsh and other shells is that some other shells run the left hand of a pipeline rather than the right hand of a pipeline in the current shell (if it's shell code, of course), but that's not something you can rely on. There is a patch floating around for a compatibility mode, but in native zsh mode running the right hand of a pipeline in the current shell, and hence the other parts in subshells, is a feature. pws