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=-6.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8236 invoked from network); 20 Oct 2022 18:40:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Oct 2022 18:40:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1666291205; b=bdStTERI/b574CgO09imo8NZqOzY4R/f/7NVT9wPZfhqDjYuITVMqFgoWy/17VKgY4PpcgJCzr GytJ1aI3Lsa76DW/y7wSQfqZ3MTU4qug90his8xrwsyU/5WYjwRiEFYFvk0X6w10z5NmqLqk1M WarW5vZcVlnmpIqrRPhqI/hEC3uU3hY8U+AkXizAlkHF6T42KRuTy7IjKGLKSDYOS9OOVXpv9F 0AGnhpSfe2UieRkZ8pNgcqgFk6AOqPDsLNILv0TBcoSqwclMJnEhG0TvaJR7xn6IedJCHlm9Ik 1NVnBXnM/Eq1dlL2u1TOZm+TpIpAbwXcs6ZxLd/Wm/4YLw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; 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=1666291205; bh=kmuV4rdS5p+TTqregQrSQ2/uvRNO1XxlGpnBZ0uUq64=; 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=Nggxza2kq8bZk82J5roe812nuFEL8iiDuR+Ty29c3k+agtvx+lGMv5Nxg5W75V2YGFLgv8Pmah T2Dx5zxT4oLCuITj6ngyRWteEYtqdDK9gsr16QukbtRPsBhfC1mgJ/EVfW1Bye6aZwjQNivChT 0wrXrqPro7mUc0osG/0OzX+kT3uLmPtyXoKfRnmXX54dvMyE1OWmDb2fTai2dec7zTMbkGIeye kqabvV2SVahBm6mT5ysOQtXe7Ab7M6OJpwodePMddgoTjePg35paWEPRvcQIMnIwLCiWiyqvVj qBEnMR+fUib5oZrdWY8auSYnd/KikDlTtQ2H4AgXJcyVsA==; 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=Jwo4jSiR+fGPJdpKBnBs0EGk+0smay2rRPjkxEI7wcg=; b=m+zKjH8+jB79e+6KQIXKBpwkNE inns3V+HGQq8cRWJARwMuMXvuST/JWpuvlFYa4a+CaNwqmvapOrgE1hbX/UsKFY2ikrLd8YP48QmC 79i+HnH3ICIQU6e7biVZn396nAwzlpsdnCB71Xy6XHxLT8i3EKVs1L5QshyFJf6y6wcD5t1vt2Es2 tw9ql3yKUl9Lq4pnAfEFnN04S3aqZ8rN5hHtcqe2StnZ5tHj49OwUEUj/izlJzI+zICGjq6jn9CtT bLyrz8raOvRBVgDA4KrrfPfspqbtIdbdZRDpLELbgxIhlfLFrsocO1ZyoX8zOnHlRS7mHWhNsilFG 51anA9QQ==; Received: by zero.zsh.org with local id 1olaSa-000Bes-9l; Thu, 20 Oct 2022 18:40:04 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:38700) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1olaRa-000Az4-35; Thu, 20 Oct 2022 18:39:02 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta01.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RK200OUNBLKORA0@mta01.eastlink.ca> for zsh-users@zsh.org; Thu, 20 Oct 2022 15:39:00 -0300 (ADT) Received: from [192.168.0.2] ([24.207.18.108]) by Eastlink with ESMTPSA id laRXomscelmAklaRYoudSP; Thu, 20 Oct 2022 15:39:00 -0300 X-Authority-Analysis: v=2.4 cv=Y/M9DjSN c=1 sm=1 tr=0 ts=635195c4 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=WFfVomAdUFSXPQWoepAA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeliedguddviecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrddvngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepuddprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: Date: Thu, 20 Oct 2022 11:38:59 -0700 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: var=$( typeset "$1" ) ... not within a function. Content-language: en-US To: zsh-users@zsh.org References: <5f18c162-e111-21ba-3ebe-ece09a477ecd@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28238 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-10-20 10:54, Roman Perepelitsa wrote: > The function is a red herring. If you run `unsetopt typeset_silent` in > the function or before invoking it, you'll see the same behavior as > you see in the script. If you read the description of this option, > you'll immediately see that everything works as expected. This option > controls `typeset` in exactly the way you are observing. But wouldn't my shell settings be inherited by the function?  It may be all as wanted, but it seems anomalous.  Why this special handling for typeset?  I can see that if you are setting or changing something, then the effect within a function will be different so various protections might be in order, but the simple display of an environment variable ... it seems strange.