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.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15826 invoked from network); 16 Sep 2022 19:44:55 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Sep 2022 19:44:55 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1663357495; b=ciNIxHbt14l7xw9d6mb758ue8pC7AnzWu4mP3QFwCqeKaRzHTxK9ZswC43MPOR0GY1fAcKnxO3 t9Fz6aSbuAuoGO+hZwUIOWxEM0h3hlq1k7qM/e9/P4bbV3fD7Q0tr3mDgb/PmFedHQCepRuNMZ IAX/mCaf9wBfD6TkQcJeoQUKWg9LPyqg50ru5Cyiqnm63Qq+bs/Htb+SEY4gcNd5FZnUJ4dZBx XQtuR1oLXUJDneNAh2DaTUfFot4uF2HPW5rL0R5KigMIMaJA2kuX+kzzA1rSyb4pcaW5lyLm7s Mik7uo7Hh2+gH3ID1Lc/cJM8ggJfz71QGfT5HwodgGxjsA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1663357495; bh=nNlpCVjB1oSfmeYtSzh+FK4jRXLA/ApR8WNtmy3WnHY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=qslaYHRqtpanOIqT7HGUS+JP/cKAWenKPSqH5EE12VafjsNYM2ouGi8EaTw+tbRnwsmY3MfuEv fCF/9pN+ynoAlctqapCXa11T0627pmWjEnz3G3oC7B0dvAMtkaz0B1R6UQ3gIzBLEfbqdxoJ4J /yq+AKaC5mkgQ7zQMDneoczTiDaOTOf6gjsShI+xpWv/SRTyDycIPHB9kQ0+ZTb3mYJ8Su+bd8 W9M8j1iMSQEMIIhvR5FgX+3b633ob5hyplgmbyg52C7lkOkUfjSFKTFvzTXL1DyXhk+429e554 PC5XDhd8n/u0WBACLNRavKYav3OFmNIE48x8yL8cB4LsKA==; 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:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=lSYtGmERAy7mHw6FXtSXrZ5jYrh65ansFqqyNJKh0DM=; b=qiLnjv8w7m9pyUWQWl7yUDG/j3 uMkgVFh5jes0vD+KfFVNy35QWTubwNXqcL3KYL0D3594+STEp709yDhmTudP2VefBp2/gSrGMaVr+ lZ9oBd/vob2hoWuFRAsHcLOKcQ809KjuVHo3TVciGghtxzQ5IIkft/Y275bfIqRIRdzYYnfjBvcVs CojplVx9dmGDUvhFDc0NQlPovYvjjTVdo+BShqxEG7H/wIz8hLXODZAjZ8/IWeBrKudzZHPaYjOCr /l5whDPZAASjdOQ/5S7wtRIiWJ2Zzk0w7IYfZVJEx82WlVqUfYIJjMCsa2tJy0UQtSN0ul2JCqKXm XwUJhBpg==; Received: from authenticated user by zero.zsh.org with local id 1oZHGg-0005bv-1X; Fri, 16 Sep 2022 19:44:54 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:52388) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1oZHFL-0004vS-Bd; Fri, 16 Sep 2022 19:43:32 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RIB00P25GUL1JA0@mta04.eastlink.ca> for zsh-users@zsh.org; Fri, 16 Sep 2022 16:43:30 -0300 (ADT) Received: from [192.168.0.3] ([24.207.18.108]) by Eastlink with ESMTP id ZHFJo2AnbVmS3ZHFJosQMb; Fri, 16 Sep 2022 16:43:30 -0300 X-Authority-Analysis: v=2.4 cv=S4EcfKgP c=1 sm=1 tr=0 ts=6324d1e2 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=gir0-LH0AAAA:8 a=5WsQpgrdMedNsoLRzSYA:9 a=QEXdDO2ut3YA:10 a=aLewGyoHDmJ4ULJHWpSz:22 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvtddgudeggecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrdefngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepuddprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.18.108 Message-id: Date: Fri, 16 Sep 2022 12:43:29 -0700 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: local but persistent integer? Content-language: en-US To: zsh-users@zsh.org References: <22a10f61-5f82-9797-4bc9-9082f9371dc7@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28100 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 2022-09-16 10:44, Bart Schaefer wrote: > On Fri, Sep 16, 2022 at 8:19 AM Ray Andrews wrote: >> integer -x start="$(( $(date +%s%N)/1000000 ))" >> >> ... I need 'start' to persist between function calls which it does > Given that construct, it should not. "integer -x" within a function > puts something in the environment (so visible to external processes), > but it's still scoped to the function and goes away when the function > finishes. I must  be misunderstanding: #!/usr/bin/zsh function tt () { integer -x unique_to_tt=2 } 8 /aWorking/Zsh/Source/Wk 1 $ echo $unique_to_tt 8 /aWorking/Zsh/Source/Wk 1 $ . temp1; tt; echo $unique_to_tt 2 ... so it's visible externally as you say, but it's not going away either.