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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5539 invoked from network); 25 Jul 2021 03:49:18 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Jul 2021 03:49:18 -0000 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:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ancaiN7pQRVP30rdtGY42RSGoJn213m7gIkwLbR2Ksc=; b=W/keyB9emZHw+a6TALD3js8dT9 BpxWjsQIDFNoDEjj5c/YB+9NibZw971PY/+kIBN4RbRSexZsB3ioWpioscUuqfPWL1Va1TvR6Qq0l Z/2RSAQtaKmLAX4T7k/4DOdqGYALDNjRdp4u4bszTNJRMZ4BDN6cbgaM7lTXilwnH3tk+LqTW+l3s grx66JHwf/yPGFubVwIo1GWrIAsfHY3IYMxO9D3//rzYuiLqdd6WqWFGXGVT8JYKOXMszdSu47XII rUXtkYKIetbUVRIF6xu0q5+T3iiUtUdkuCo7sgAjf8PveZesyINMR8ppbr9Q6sYx5JedMIz6Hu3zA NWUogjjg==; Received: from authenticated user by zero.zsh.org with local id 1m7V8g-000D7u-0N; Sun, 25 Jul 2021 03:49:18 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m7V8B-000CPY-0m; Sun, 25 Jul 2021 03:48:47 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id 455A727C0054 for ; Sat, 24 Jul 2021 23:48:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 24 Jul 2021 23:48:45 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgedugdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephfgtgfgguffffhfvjgfkofesthhqmh dthhdtvdenucfhrhhomhepnfgrfihrvghntggvpgggvghljoiiqhhuvgiiuceolhgrrhhr hihvseiishhhrdhorhhgqeenucggtffrrghtthgvrhhnpeduheegteethfdtleehleelie fhueffudfgleeugefgfeejueekledutdfftdfgjeenucffohhmrghinheprghllhdrtggr thenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrg hrrhihvhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduhedukeejjedt gedqudduledvjeefkeehqdhlrghrrhihvheppeiishhhrdhorhhgsehfrghsthhmrghilh drtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 24 Jul 2021 23:48:44 -0400 (EDT) From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: CONDITIONAL EXPRESSIONS, string == pattern Date: Sat, 24 Jul 2021 23:48:44 -0400 References: <45ef93bd-148b-54fc-9815-5b5dbe71d1f0@gmx.com> To: zsh-users@zsh.org In-Reply-To: <45ef93bd-148b-54fc-9815-5b5dbe71d1f0@gmx.com> Message-Id: <6A60A149-8728-4140-ADBA-AC67ABDD3BF6@zsh.org> X-Mailer: Apple Mail (2.3445.104.21) X-Seq: 26807 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 Jul 24, 2021, at 11:30 PM, Eric Cook wrote: >=20 > so in: >=20 > eval echo 'test ${vs} =3D=3D ${vp} && echo hi || echo lo' >=20 > zsh does the normal expansions of the line and passes the arguments to = eval, since the single quotes prevented > any possible expansions the result is: >=20 > echo test ${vs} =3D=3D ${vp} && echo hi || echo lo >=20 > so the above line goes through the steps of expansions and ends up = like so: >=20 > echo test ' str1 a2' '=3D=3D' = '[[:blank:]]##str1[[:blank:]]##[[:alnum:]][[:alnum:]]' && echo hi || = echo lo >=20 > so /echo/ prints out the strings given to it, which succeeds, causing = echo hi to run. I'll just add that examining the full contents of 'r' would have provided a big hint that 'test' wasn't being run at all. % cat /tmp/testing2.zsh setopt EXTENDED_GLOB NO_EQUALS vs=3D' str1 a2' vp=3D'[[:blank:]]##str1[[:blank:]]##[[:alnum:]][[:alnum:]]' r=3D( ${(f)"$( eval echo 'test ${vs} =3D=3D ${vp} && echo hi || echo = lo' )"} ) typeset -p r % zsh -f /tmp/testing2.zsh typeset -a r=3D( 'test str1 a2 =3D=3D = [[:blank:]]##str1[[:blank:]]##[[:alnum:]][[:alnum:]]' hi ) --=20 vq=