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,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17368 invoked from network); 26 Nov 2022 15:04:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Nov 2022 15:04:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669475053; b=JqJxzh8cWtJ8CoMeDWRzqmAPkyIAoV+Cxojj9ZUZaiAY3EsLRjvit9VMwTcY+yvTnY7XfoCehl edj+Nl7LWIuvjLMc1IieSvy3F4plF8NMXpLmCpqXzcVBqTjknk8mWn1qjMG1eg6UJbG/ghUp3C /jwh7CYvMCqQxLiHTA1oYQLixCTff0FwdIIIveJm3wSvJXt1S28Ee1TuuGAKZ9D0OUnPcvAs5U 3jJeWB6i+LEs8kZBcHfTjMU1qJEXrnrDkBEl4tDh/lck3LuK3AmqQ+jn9LOSWu3RMPG2e3LKeu m1G2VBr5RXlWUsdlPPS8hVM5Wj4SJmOuN9uJHAsWRxMf7g==; 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=1669475053; bh=vUtFNjQ8LZulDcDXsbKhZKoZtn/Dqay18e9F2ELS48I=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=aHK3C2Y8lBvwXGDV3ntrNb9N1Rit0IyP5KlgirP4InNAf/vPCJ5h21JpxNTRXmDWx4+9TD1+pQ xZlBohEVVMzwiXHV44Rn7V3Hti7vvoj6I7dr0odKoZbcIhtPpl73hWYCMnrDL8CE6qsP0QG+Z6 CWhVmvLM1cLS+r0MnUFzJ4EMPEz++hOvsMwSIIB0btTtWXYUhQWxeL8/6nDd09WpR714J+YyNP X/eYeBZyjyXchdcdZsS+kCWn3TzoQl8I+F4pZft61hYU0Z0n3K2l0DpaNcso13Na+k3RGnFd94 Qzyf6/WrNP9z0aCydIksopj9FiR5b3Wguo97ncicoz4reQ==; 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:In-reply-to:From:References:To: Subject: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; bh=lMU8XGI5mxjoQj/Eo9pmrxCcsdCDOuDG+/3O/eJDJcc=; b=U9/YixIwh3sqfqXhcnoX5lF6V6 L6uSfneMaOSddkjQgml58QWuW+g8xLYu6niJzOvIp/jDhvTsGWNPzkwfDImIxuxNx56/WjS+7NhOu a4KsnTRT8CVry18kMfFh3yvMPvcyWO9JFNeE/BQN+MfUlQ7pEWArDg3PrOsdMvOUKbTKMUgWuWNi3 hX+QuUAEEnEFNlTX4TA6Hi5HITYSexR4sz824rooIdFhADgpCHkpZ6cgPsI5QlZvo7888luw6xS6O WlOg6VL7WjdA1Hps2MdV3hTGA9GmLgS+/VhIm2KXJngqjp4GjzT5ImJ0DyjFsBJqwBMtJXuD2Um1t KRAAosKA==; Received: by zero.zsh.org with local id 1oywiy-000MSc-5m; Sat, 26 Nov 2022 15:04:12 +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]:59480) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1oywi6-000LnZ-7x; Sat, 26 Nov 2022 15:03:18 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RLY007PSKLQMEE0@mta02.eastlink.ca> for zsh-users@zsh.org; Sat, 26 Nov 2022 11:03:16 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id ywi3okB2LkffJywi4o1X0y; Sat, 26 Nov 2022 11:03:16 -0400 X-Authority-Analysis: v=2.4 cv=Lbf6qBTi c=1 sm=1 tr=0 ts=63822ab4 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=BMZcCVJF39lAb5JVOnoA:9 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=2c2qJ9-fBLGv-5EQuu8A:9 a=Bcb2fuSt12DhojSz:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieejgdejhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepgfdtvdduheevuefhvedtgfeuteefvdfhtdehleethfeiudelueekjeejfffhhefgnecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------eNakF2lvAKx8hYmXDEZITBQ1" Message-id: <0587d081-5941-2634-80f2-69ed537de651@eastlink.ca> Date: Sat, 26 Nov 2022 07:03:15 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: trap question To: zsh-users@zsh.org References: Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 28435 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. --------------eNakF2lvAKx8hYmXDEZITBQ1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2022-11-25 20:50, Bart Schaefer wrote: > No, it should not be on. I was giving an example of an error where an > exit trap would be tripped, not implying that you want that condition > to be an error. If a command returning false is an error you should > be explicitly handling that and doing a normal return/exit. > Eventually sure, but when things are unstable it's at least nice to have zcurses powered down under control, no?  I'll set that option and see what transpires. Lawrence: It's not a special case, just like "eval" isn't a special case. I'd put it the other way: trap and eval are both special cases, no? Surely the general rule is that nothing is ever expanded within single quotes? Now, if you use single quotes instead of double quotes, the first argument of the trap command expands to the string [[ $var == '0' ]] && echo trap: var is: $var, which looks like a much more interesting command to execute when the EXIT trap triggers ;-) Philippe Ok, that makes nothing but sense.  The single quotes do what single quotes do, *but* there is also the intuitive way that the trap is always 'in reserve' -- it never does anything when/where written, only when sprung, so at that time the quotes are gone and the variable expands to it's value in real time.  Got it.  It's sorta like compiled code. --------------eNakF2lvAKx8hYmXDEZITBQ1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2022-11-25 20:50, Bart Schaefer wrote:
No, it should not be on. I was giving an example of an error where an
exit trap would be tripped, not implying that you want that condition
to be an error.  If a command returning false is an error you should
be explicitly handling that and doing a normal return/exit.

Eventually sure, but when things are unstable it's at least nice to have zcurses powered down under control, no?  I'll set that option and see what transpires. 

	Lawrence:

	It's not a special case, just like "eval" isn't a special case.

I'd put it the other way: trap and eval are both special cases, no?  Surely the general rule is that nothing is ever expanded within single quotes? 


Now, if you use single quotes instead of double quotes, the first argument of the trap command expands to the string  [[ $var == '0' ]] && echo trap: var is: $var, which looks like a much more interesting command to execute when the EXIT trap triggers ;-)

Philippe

Ok, that makes nothing but sense.  The single quotes do what single quotes do, *but* there is also the intuitive way that the trap is always 'in reserve' -- it never does anything when/where written, only when sprung, so at that time the quotes are gone and the variable expands to it's value in real time.  Got it.  It's sorta like compiled code.




--------------eNakF2lvAKx8hYmXDEZITBQ1--