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 1785 invoked from network); 20 Oct 2022 17:44:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Oct 2022 17:44:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1666287848; b=XlyVo/MQefPenDGrjtUVJQZiyKpNjEC+bwkAY0lK3VUX2sr+5oZHcqXHUCHB1s/n2+Ztm36ddD Hc03WEYQZXyaM7fyt80jNy4VY0KMJOeOo6nCBfcq5zMhngKEjt7ak6aqChlEac86LvORiLXarl hvaOWtY7w4zD1gSl7blU1/fp5Tkj2V+OHey8LdUr6kclMHBt3FC0x2mWYtfwy4rNKAiTbYKmFz PreS9aONK/uBafnxw7VIKwPSR2LyeJhDSY2RNN0knzPRANO5HKacTnDvAnrcgHHSBzL9WaYUoB 4ux8Cg1zy+wroqXhPTEB5lA9gzw0Njp6BoyPl3zAFBGERA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; 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=1666287848; bh=fQS4d+l14hn2NysSdnsy8ytRyDHOyd6rt8W25h4IW2Q=; 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=lDcooZWjcVnuxPnbo0ZKK04QcBzjf693i73u5PXWggZNC4NWHYgFJ+dxzqHpyB9W2LZ4X4x17S niL6QnL/qql9O7Q9vRQPtuXMVXNz1jVxD86xNlZyzW5fnXu/ACaWAMM7dl+fbn3XY3J05LDIzc HyWrGN/pwu6Gxxnlyz3nIqoX34ncU7+aXXrrHyVnkNiY22AyJ8wIaL4Oj6e7mQXIEPKusRSR5H zWpvqbIUaOdVTPSyuQ76m5avZ2t45E5uexUjNZ7KasGyf2DIeXGG1270CIbi/KfO0SXtTQlfcm rqtWwQMw3E/z4xOrRaox6VWpE2D0K2YRhgKjqJ+YmHJnZQ==; 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=6yKKqyDHtISzgoFObHzqfjwlZzfBv6hnrSki8lhRZk4=; b=Gf072esg4rMfnKriCmwm7yqCsF tQbiipY6SLRy62sPPHEqwmIxqau2pWqwzBUIRUHpD5LQ6NSSsZYLL5s1Ez3czT03bDbzyZIVEMs1J /yFD1C+PuW96uMlCwRJni1hyPXNqRSZmy4LJELHsnwiYCfOA2kR0WQ2U4eMIV0N/XhmMwZA9e9NyH 7n4XU6JfLOWQYGBb6xLjVVvEkT3zmwwCXIIjHGttT6okR7/Zm6b7j39gJj3Ks5CJCZ9Rnzjj+WMfq UIcmhF1t4frjGGAmHW9JtDDhH+8+cOSibtG/FAe1iOyfGCFOEISAWi6djq4pDYyoyRKPWENc0Xncv Zw7n8DaA==; Received: by zero.zsh.org with local id 1olZaS-00071h-Km; Thu, 20 Oct 2022 17:44:08 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:35937) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1olZZa-0006IK-Hc; Thu, 20 Oct 2022 17:43:15 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RK100MSFXXNMHI0@mta02.eastlink.ca> for zsh-users@zsh.org; Thu, 20 Oct 2022 14:43:13 -0300 (ADT) Received: from [192.168.0.2] ([24.207.18.108]) by Eastlink with ESMTPSA id lZZYo0n6jlgn7lZZZo2nfV; Thu, 20 Oct 2022 14:43:13 -0300 X-Authority-Analysis: v=2.4 cv=NL8QR22g c=1 sm=1 tr=0 ts=635188b1 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=gir0-LH0AAAA:8 a=1jc7baxTAQ7xFBzQeIkA:9 a=QEXdDO2ut3YA:10 a=aLewGyoHDmJ4ULJHWpSz:22 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeliedgudduhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrddvngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepuddprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <15ee880f-d6af-4edb-579e-f512fa7eaa3d@eastlink.ca> Date: Thu, 20 Oct 2022 10:43:12 -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: From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28235 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:29, Mikael Magnusson wrote: > On 10/20/22, Ray Andrews wrote: >> function ii () >> { >> var=$( printenv "$1" ) >> [ "$var" ] && var=$( typeset "$1" ) >> print "var is: $var " >> } > What kind of logic is behind this code? You first check if the given > name is in the environment, then you assign over the same parameter > again with the same value using another way to get the value. There is method in my madness.  printenv there returns "root", typeset return "USER=root" and more importantly printenv does not accept wildcards and  ... nevermind -- the point is that whatever my motives, it seems strange that the code doesn't work when inside a function. >