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=-4.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11854 invoked from network); 8 Jan 2021 17:14:21 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Jan 2021 17:14:21 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1610126061; b=M815QPSGxYldhYtYQEn6RCAT9vt0UsxXuLMNMjbxhj6jII0nJvzSelIgJAa4EbJIhTjcy83exV 8kGU8LBRC83h4iicUvxsYO/RoadBjdztVR+DTp7jlw+MJstWJ0+4b0X/Zl3HiCfDVq1ycwojDo DFFxbamxGP3PxuAPOJt5o0lH0CQp6+yLIMtI7VF9SkhX1Dx+Oe+cBHV/0+hT+XHSIFqyIDFZEY 6OZ9Zf/Q44KZKeUWl4fTiBUUolFHPoVmOkZlU64tl3W8Mr8W8jtVX/8S0WVyp5w4JMycIV9GZv gx8/bktyg4/J9eUUkIjmmy7ZIVTOEsZZJkLZlXR89wx7wQ==; 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-20200801; t=1610126061; bh=hkp5zhh2e7M5/x4pVTRI7vmc6MmuGnUtcoPvsefJBzA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature; b=n8t1nWXVy8gqSFyG7tFEG1Qg/gm9TSBTfDfUyfOtp1tfcidOt/DfOewMxMqNrPkKXz2/kNE5DN CDjWZupxQ5OiVuEPhn+YPWC0Wopw8PH0ifvTp3ybj7lr64CzEXafWDXGd3Bh2MXdS0DdKlG0kK QYBwf7YO0QwhAULKyY+KwM4DP702HzpQFk1yi0xRxVg01Iwv6DFLVdD3sa8Mp3Eg+/YClgA26x ztfT7ELzV6CA1Nj6SZDq4OXCm4Z+3H9paX0Mg4QTnSH3HZ5084hcdKv11WmWQHlT5QN6pNVL1H wmrpyfCclR81i5zwOEqd/GXKW8rmguaLMrQv0/qzD7lnZg==; 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:Content-transfer-encoding: Content-type:In-reply-to:MIME-version:Date:Message-id:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=lqI6YhYixf8gU9/V9aUJEFDDzTc59ncj+KYXalx2OIg=; b=jzEy91zZg0YdS3IWRfFyN+wLEY cjaL4N0OIepFjHTKTYR6eUHXdFwFf6grHqRfCgkvCYCJQnmPbKtdh/KxdTQZekj4ImbRJCVe3Kr0z 7/e/7Vr56wvOg9M3g/PdLXqHA2ofdreaesg7DvZxMSOqQ+G29q6DNAoFve29pjfjGvRCRvxUSezLV Os+Vwiaj79CryKEC/EzGslSQerj3zdIUR11A7DChV8UK9yHu9JqQf9X0S0K5MDz9aTHFbar8X6dab Tk9Wp/9/YXU4COtkO8qPHzgKg+jHYxyaW/ngRbUQifzByTO5hj7X5qyXkt/jAwgeA0x56B0LzQ5KZ S+908vBg==; Received: from authenticated user by zero.zsh.org with local id 1kxvLB-000NYG-Bu; Fri, 08 Jan 2021 17:14:21 +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]:60061) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1kxvKc-000NC3-MP; Fri, 08 Jan 2021 17:13:47 +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 <0QMM00MHQKLUJQ82@mta02.eastlink.ca> for zsh-users@zsh.org; Fri, 08 Jan 2021 13:13:44 -0400 (AST) Received: from [192.168.0.3] ([24.207.90.194]) by Eastlink with ESMTP id xvKakFb5lBfFDxvKakAnFT; Fri, 08 Jan 2021 13:13:44 -0400 X-Authority-Analysis: v=2.4 cv=Ncoja0P4 c=1 sm=1 tr=0 ts=5ff892c8 a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=z8-tegKEuuxLmuMpL18A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeghedgfedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepkedvueeuffefhfdvueeiteffvddtvdejgeeujeekieduheeiteeiheegtedvhfefnecukfhppedvgedrvddtjedrledtrdduleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdeltddrudelgedphhgvlhhopegludelvddrudeikedrtddrfegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: here document within a switch fails to parse. To: zsh-users@zsh.org References: <20210107153248.GA25249@tarpaulin.shahaf.local2> <14e91024-d65b-e3a0-f5f6-8f0e55d40e8f@eastlink.ca> <10257162.hLkh6h4pyX@thor> From: Ray Andrews Message-id: Date: Fri, 8 Jan 2021 09:13:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 26348 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: Archived-At: On 2021-01-08 7:53 a.m., Lawrence Velázquez wrote: > On Jan 8, 2021, at 10:27 AM, Karsten Borgwaldt > wrote: > >> Some expressions in heredocs will be evaluated. Not a good idea for >> comments: >> >> :<> $(print something > /dev/stderr) >> EOC > > Not if some or all of the delimiter specification is quoted (as Ray is > doing, in response to a suggestion in an earlier thread): > > : <<\EOC > $(print something > /dev/stderr) > EOC > Good to know!  But playing with the above: function test1 () { :< /dev/stderr $(print something from a function both > /dev/stderr)       # This is the only thing that prints. print something from a function COMMENT from a function echo "echo from a function" EOC } ... not to belabor it, but why in heaven is just that one construction evaluated?  zsh always has a gotcha! waiting, but someone obviously went to some trouble to sniff that out. Neither the '$' nor the redirection is sufficient alone but they evaluate together.  Why? I'd better read up on what here documents are really for. And it isn't comments!  But when I want to quickly turn off a hundred lines of code, I succumb to the temptation.