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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21486 invoked from network); 19 Nov 2022 14:35:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Nov 2022 14:35:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668868526; b=RleLLfPZ8Gyg5GDQg0YV9xNTL9TfIKir1JJauJtH6t+riEKbl4lmkyfnZmFv7XSSgwfFxJ72AI mxHGQHvSuGJiFditQGHPE6HN/D8mSWXEu/1DZqH8Yw6um7aS9QN1Iv59CuY8tS3Wc9JBMDe06Z WqAFLXL4jxZqoTh2rZwaHy2QpMt1L9h7sp40sykgfXJEAQelG0lLcG5R/p9VaGMFjvMl42pc+A 5xujq9rtsWGMtqiNfkACx0Llj6SitL0lMwJWG1Q8951nnPkCxXJytNONHHeCkIIywwtL7h6/Ef dnyPXCwPPU+y05FfojnHjuQxY58XDZzwbYLCDW7Wsy4/aA==; 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=1668868526; bh=DSYzBHCHKoIO1OkLkB4PTQIwEMnlUHQl/sP59i6U6jE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Subject:From:To:MIME-Version:Date:Message-ID:Content-Type: DKIM-Signature; b=DLUY4lukx1U0EsUSgZmi1gDgLBiQflzznokiwJQfn6jJf3p2kiVuJ9lU5eNF2i7AL8vIXdlS3l J16Lxh55fK0fV36GmRhiGOnGJ4zQl2O/ulVQA5ZSkvcMlafvWBmDGvzLG/OMFjiIJkHPOAf5E8 iGRsm4aPW7bb6ffoCzAN2xsTcwU0QsyXadU7wjtu2GhA1rUn1uWPK8UNcDHsITb+lTf4v6fLm8 NKTrdWHpdsuTpFpuTmlEgq/2+msoB5kXI+tW8gkF6dtLaRy1NXYwMUsSFeF3twaBCAjjcMH2e0 HTSviTuHmIHj5GZGEhIBOwXY1PtpPWIn/vlY/fO59YMKTg==; 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:Subject:From:To:MIME-version:Date: Message-id:Content-type:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=WwbglCSTbSVrYjqzeOqOPpqhhnwO0rRXSalJ0Yg58p4=; b=q6590Iz7KgiuWmCnUOCcSLGX/M /pjL7X86WODPVtx3TWutOUlUK3G10Rw9XN3BrQiFqIQDr5HUch4OyhYnheiTXB4Sg+rUvto2KG+mW awU98txREHKLH2YDA2OBClLnfIHn6xijcIq652Rn1AhaFEjDsACsAt5M4QVwJhOk1bEO7YlXJ5b0M 7dp807t17blsL/FMz0pBbs/eY55p2/9RbZ1PZl1j4i4GuxEOWz3AoJzQG/K/9ys5iBiJ5V9mbpGaz yXwBzBBzbz/cLVV0DlEGMPj7hPKIo5P1F+HsdCHakqAJiPviZxou0JERvyH0Ed4lXF+iuX5nOGP6y /x6ON+TQ==; Received: by zero.zsh.org with local id 1owOwI-000P02-Ez; Sat, 19 Nov 2022 14:35:26 +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]:46593) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1owOvQ-000OGn-Rv; Sat, 19 Nov 2022 14:34:33 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RLL00HJ5IG72BJ1@mta04.eastlink.ca> for zsh-users@zsh.org; Sat, 19 Nov 2022 10:34:31 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id wOvOoN8A2kffJwOvPoxQmb; Sat, 19 Nov 2022 10:34:31 -0400 X-Authority-Analysis: v=2.4 cv=Lbf6qBTi c=1 sm=1 tr=0 ts=6378e977 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=fkE49-z6Yns6Eg06RJwA:9 a=QEXdDO2ut3YA:10 a=JrGLiwBt7uMNogNY9eoA:9 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrhedvgdeikecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurheptgfkffggfgfvhffusegrtderredtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeejjeffgeelkeekheeljedvkeevhfdtieevudeiudevkeevvefhkedvheegueelkeenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrdegngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: -100 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------BEmbof7OvlmnIsShZldVnZFg" Message-id: Date: Sat, 19 Nov 2022 06:34:30 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Content-language: en-US To: Zsh Users From: Ray Andrews Subject: why is eval needed? X-Seq: 28409 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: This is a multi-part message in MIME format. --------------BEmbof7OvlmnIsShZldVnZFg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit  In a script: local level='-L 2' tree $level #eval tree $level run it:     2 /aWorking/Zsh/Source/Wk 0 $ . testing     tree: Missing argument to -L option. If I use 'eval' it's fine.  Now, I roughly understand that we need 'eval' when there's some complicated nesting of expansions or some other complexity, but I also recall that in almost every case where I've discussed an 'eval' here, I've been shown that it isn't really needed.  In this case the expansion seems so trivial that I'm puzzled.  If 'level' were some other switch that didn't require a space in it ('tree' demands a space between the 'L' and the number) then it works without eval, but what's the issue?  The '2' is there, why does 'tree' not see it?  Is this one of those invisible bogeys?  Something about argument counts or such?  But quoting didn't change the error message. --------------BEmbof7OvlmnIsShZldVnZFg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

 In a script:

local level='-L 2'
tree $level
#eval tree $level

run it:

    2 /aWorking/Zsh/Source/Wk 0 $ . testing
    tree: Missing argument to -L option.

If I use 'eval' it's fine.  Now, I roughly understand that we need 'eval' when there's some complicated nesting of expansions or some other complexity, but I also recall that in almost every case where I've discussed an 'eval' here, I've been shown that it isn't really needed.  In this case the expansion seems so trivial that I'm puzzled.  If 'level' were some other switch that didn't require a space in it ('tree' demands a space between the 'L' and the number) then it works without eval, but what's the issue?  The '2' is there, why does 'tree' not see it?  Is this one of those invisible bogeys?  Something about argument counts or such?  But quoting didn't change the error message.



--------------BEmbof7OvlmnIsShZldVnZFg--