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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10260 invoked from network); 25 Nov 2020 13:19:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Nov 2020 13:19:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1606310386; b=D4iAbx3Anmz2OdB6fktojJclOEeMu+JIXLCMXUuXdHgEPfZPYiJBC4CsBn/5ZUmse8JYfjZMgs rGAOGNEJLQQ9Uf+uG1ZJMYC/BDFvf8dregoDYNGgnmvcj5W/cE97cJ7A4PbH8Q+dS6L1yqphSR Rzj4qjFvASa3ReOG0U5c25iuermQbl8wmNWZap/UvC0tXmRyloRYwGX9v243qZJ/D6rqe0eFHN J+L34zZTMEUWk42oZI8eDXcach4uYwYavTBpkpZVCXClWty/f1FYXeTwOLAr1CX/NNlsCFoYdq 5f50xfYM+lqh0OCXSrUKA+ua1zmgbI4U0UdYeCBeIpc6lA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay12.mail.gandi.net) smtp.remote-ip=217.70.178.232; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1606310386; bh=xI/2Z0JVmg3EYlc0e9amQXJsWFBvUBr2vWonaRmXB9g=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=JZR6WqsSGtTgLuU+xFN0G39VFYItDQuPezE2vydwJvCj82lHXDbTxgRSnXbVFXnS+3ZLl/edBE sAtqntJiOciP85P3NiNIgr1VT9s9sQo1C70KXvFI1laORsfBcSAKA7xGCebQvYl3tdYbJQvvsk D0N1l6LCNLC9qm6ErjLbMSVg3Uf6ttuQEUfQR9RxHx2Efxks88wjDiVVowgor6AR+/JsNzq55/ e1IslMqZcQsrM46jxkfYo0poRZpKQB1Ktw3MlwUMsIeAJCEK1Zy8r67OXtMDUbximi2zbZ0h6L PA62zy5341+L1i9oo4ZswaW7JYFRDwmuf1PLYJfJ03Lprw==; 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:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=lcN9uJnzb/zhoqfzoNtyIAqueh45VLT47kqL1VVo5hU=; b=qL9xmAjkVYVNkfMGA+tj9pyq8k OvPqSPe3HT3X2kWGJhJ6YLFXG62sPy8paGwV2boRYYpSmL31Eviv2uL9RaUsYrA0vIS80netdA8Kv O5XDIzQRrDcPbAKM7+BFAjiesZPAytbxsL3Pyt8D2zezba95vMteIYuBbvHytZl0OK5P7di9KQuP4 T8YN0abTGmLlJm71qd2ZdLhfHC2lnHshWtNIdC1EeMCbzJfk8Tt6Nmz2pXfLYYIYcvy8A6qne8K2o d7cIfnsjyg5WwHNMym3fGllsiLldXmfYOu8cMkteyp3mOZ9YZbaXwAR/SlvYrzQjWJnJsJ/dt2TUc 17fquNGw==; Received: from authenticated user by zero.zsh.org with local id 1khuhu-0006wd-Kf; Wed, 25 Nov 2020 13:19:38 +0000 Authentication-Results: zsh.org; iprev=pass (relay12.mail.gandi.net) smtp.remote-ip=217.70.178.232; dmarc=none header.from=chazelas.org; arc=none Received: from relay12.mail.gandi.net ([217.70.178.232]:39083) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1khuhf-0006n5-FG; Wed, 25 Nov 2020 13:19:24 +0000 Received: from chazelas.org (unknown [94.10.124.211]) (Authenticated sender: stephane@chazelas.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id CBFFB200007; Wed, 25 Nov 2020 13:19:21 +0000 (UTC) Date: Wed, 25 Nov 2020 13:19:21 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: More rabbit-holes with unset variables Message-ID: <20201125131921.vay7h3xk5qn4odgg@chazelas.org> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 47624 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: 2020-11-24 23:02:05 -0800, Bart Schaefer: > I was experimenting with ksh to look deeper into adding behavior to > ksh_typeset in zsh, and discovered that this example: [...] Sorry I didn't read the full discussion as I just subscribed to the list, but I did have a look at the differences between local scope implementations at some point and there are many many variations between shells. I did find zsh was far from being the worst one there. They have been discussed at length on the austin group (POSIX) mailing list as they've been trying on and off to specify a local scope for sh variables. I did write a quick summary of some of those findings at: https://unix.stackexchange.com/questions/493729/list-of-shells-that-support-local-keyword-for-defining-local-variables/493743#493743 which is very relevant to this discussion. See https://www.austingroupbugs.net/bug_view_page.php?bug_id=767 for the POSIX attempt. You'll find a number of lengthy related discussions on their mailing archive. It's after one of those discussions that bash added the localvar_inherit and localvar_unset options, and NetBSD sh added -I and -N options to "local" I beleive (the mantainers of bash, NetBSD sh, bosh are regulars on the austin group mailing list, FreeBSD sh maintainer is seen occasionally). -- Stephane