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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19290 invoked from network); 26 Oct 2022 22:20:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Oct 2022 22:20:53 -0000 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:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Q0HMhEPWaa+HalQfU6sU3EpTGXpgCetZmm0HtcGyjhw=; b=BV7k1gO3Xc6AjEa0nUuYqKfe+V 0d/UKuwSJ/EwgAYLDKijJKzRUaHEfUGZTTl2HUl6XME5tBb2Oqe0YSHpaBiyETe5U4XO7+2+qCJJ9 nh0yWLZ5IuG7k1Li8p2oacDdvD57stxOiSku6KpK1Yk24uewrZWLPaEBpYl5r/Rsmj3RUaaiqqK4V l9FialZGQRdzlQ0qyShfMe4DP4WpOG+ypSsToiTp6NXBE0fWU6Plx3Z2dGOWP5D4o1UiENB/6Xxhz PpWEDVx4CX3jnCH5TXYvbPME07MHVYWGJrEuSI3mApxIWVu/7gACHWlby8HXDqE6U39Gz8MTsTncZ B/O1eMPg==; Received: by zero.zsh.org with local id 1onolZ-0003du-3A; Wed, 26 Oct 2022 22:20:53 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1onokc-0002vD-V6; Wed, 26 Oct 2022 22:19:55 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 69E7A27C0054; Wed, 26 Oct 2022 18:19:53 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Wed, 26 Oct 2022 18:19:53 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdefgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpefnrgif rhgvnhgtvgcugggvlhojiihquhgviicuoehlrghrrhihvhesiihshhdrohhrgheqnecugg ftrfgrthhtvghrnhepheegieduieegvddvffdvgeefuddugfetvdettddtfedutdejvefg jefgveethedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheplhgrrhhrhihvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeh udekjeejtdegqdduudelvdejfeekhedqlhgrrhhrhihvpeepiihshhdrohhrghesfhgrsh htmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 40C1A31A0062; Wed, 26 Oct 2022 18:19:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1087-g968661d8e1-fm-20221021.001-g968661d8 Mime-Version: 1.0 Message-Id: In-Reply-To: <8276c2d0-5824-c02e-d493-b801b2b4a225@eastlink.ca> References: <69b17354-ba70-5e88-2d89-1306fe4e8795@eastlink.ca> <9ff6d6a4-338c-4797-887f-c557eccfb020@app.fastmail.com> <8276c2d0-5824-c02e-d493-b801b2b4a225@eastlink.ca> Date: Wed, 26 Oct 2022 18:19:08 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Ray Andrews" Cc: zsh-users@zsh.org Subject: Re: can print but not assign to variable Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 28276 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 Wed, Oct 26, 2022, at 6:07 PM, Ray Andrews wrote: > Ah!=C2=A0 Yes, I do know that.=C2=A0 Yes, we must force 'var' to becom= e an array.=C2=A0=20 > Stupid ... when I'm doing it with understanding, I get "( )" just fine= ,=20 > but when I don't get the necessity I'm lost :(=C2=A0 Ok, all clear. Additionally, your original attempt -- var=3D(#i)$W/rap -- is not actually parsed as a plain old scalar assignment, but as a command preceded by a temporary array assignment. Here is a simpler demonstration: % unsetopt EXTENDED_GLOB % fn() { typeset -p var } % cmd=3Dfn % var=3D(#i)$cmd typeset -g -a var=3D( '#i' ) With EXTENDED_GLOB enabled, "#i" is treated as a glob, but this fails because it is an invalid pattern. % setopt EXTENDED_GLOB % var=3D(#i)$cmd zsh: bad pattern: #i --=20 vq