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, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4004 invoked from network); 16 Nov 2022 02:57:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2022 02:57:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668567421; b=O+Ftg7vPBLXAmH4eV4uRus8MgToSrO3wZUzv069yb1jzLFC5bkN69f17ko7EpW51ncAvtj2DZK XcMHZTOY6yqtncgtb2N/a83RVw1q/8RliS3fLduWoA1I3DnxAUDERp4Ws265l1h7LFDxuDNT6s I8ttLBFU6XxxhRhEzZwNlA0c5NP1CFYeMJbQ/LF760+Uj65HNTAsLubA/3kmvRuZDuPNHoADlF glIQQmtLbL957MffxnxwxaoBahncyswl7W+r12/HSizspzUVLZaJPs7LSXlnAkYHgdDTfTMWu/ FhkMpiCp/CWbAmeVRS8nyKeuh0xLEHjEDOrel6xyuVfnEQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; 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=1668567421; bh=iSzVn5COlAxNdziICvPqiS3nXWgVW3HDzlxxtHcmO44=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=mfhUpXsv+ggxXZZA+8B3VQkC9n1SXZalEmFRP1ytRErJPOsTaNxp7JjUC+lCQ8guQfZsr9Jdt/ VTdGS4gFUTMB+qAVkpDl65HI6wXdrupA9RbeArKEJS4eMlvv1Hgt8KMNxgOKyUuC8s9Kq/rEG6 wH2wfi5aobDn8HE6RaYtHTSJF4RcLrCIsM4q1aCJlyB6LcrRFA+2kL3CxCsEbA4gfQmylSHvVI xQzD6xNv8YG/nMXhJlv6lJb3ktImMkwrSHLFnF834lPov4q0BwawTUbPbqCyb/uQp3y188Ck4S DLl4ny8ZKH6AR/ppnKUS2xd1UN+6mZuySpr1BxE4zaTmKA==; 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:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=0j6JvrVPmX67WKvMpfmUmI0vQxSt4DGDKxriwsbmurQ=; b=PDILSbD+KwdS6+AJU52J3LxniT juGV2s/YAV+nPP/M7r93Pg+irX+hS1u1iN3Vm3CNg/kgieuYkLea08tjgabBeEpPL/gDp33f0v6Yt 5KcrpzM4Nt217mBl4IMNVqKDJTq3Ek8CyThXsci2vh7LAnaJALFBl9yOOcmDavfTmYgCIVhLH9gsB XgB1c5I1Q3w2EGD3y04w0h6n79IdQz/u+uF+Jj2Fkquqx4EL3/5omdXTr6/Joz50CvEuTXpIM4Hu7 sTDv/fwowb5HU1MPu3tDDj25SrR3FRUX8Vmi0X0b1hsINZdXxK8C2jp90m9OAiPEcncfGJUmy6Tls odqpJCBQ==; Received: by zero.zsh.org with local id 1ov8bk-000Ebo-L0; Wed, 16 Nov 2022 02:57:00 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:57803) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1ov8ZF-000Doo-CU; Wed, 16 Nov 2022 02:54:26 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta03.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RLF00BW86O4YT51@mta03.eastlink.ca> for zsh-users@zsh.org; Tue, 15 Nov 2022 22:54:23 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id v8ZCoJ3pkgfyjv8ZDofWWW; Tue, 15 Nov 2022 22:54:23 -0400 X-Authority-Analysis: v=2.4 cv=M9uLaQ8s c=1 sm=1 tr=0 ts=637450df a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=al-ZG_OhG_AUQ8tPH_EA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeehgdehvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrdegngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <0ce205d5-31f9-907a-61bd-1bf5acb37f0f@eastlink.ca> Date: Tue, 15 Nov 2022 18:54:22 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: Belaboring substitution syntax Content-language: en-US To: zsh-users@zsh.org References: <6a92000c-dee5-a1e3-a77f-6a4697a66ab1@eastlink.ca> <34a949c4-0853-4c65-d2ad-db40749dff81@eastlink.ca> <2dd50dc8-cdbc-02e0-0e1e-485718732d0d@eastlink.ca> <3a10f310-3ee8-d3b4-f6db-7fdb18b81b1f@eastlink.ca> <77692192-70b3-8a6a-fd01-d5f8b37f59b2@eastlink.ca> <879a8fb0-74b7-5250-d2ff-2f60585f48a4@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28390 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 2022-11-15 17:49, Bart Schaefer wrote: > BTW you need to stop thinking of these as "lines" -- line breaks have > nothing to do with it. Because I've never had an element that was more than one line I tend to say 'lines' but I know abstractly what you're saying.  I'll crash into the issue eventually and I'll be ready for it. > Conversely if you write "${array}" or ${array[*]}" either one with the > quotes, you get the entire array joined into a single string. Right, that's quotes doing joining which I expect. > Quotes ALWAYS protect SOMETHING from expansion or interpretation, > unless you start throwing other things in there such as eval. WHAT is > protected differs: Double quotes allow ${param} and $(process) and > $((math)) replacements but protect syntax tokens and glob patterns and > whitespace; single quotes protect pretty much everything. Yeah, I get all that.  There are times when I want to protect but not join tho and it gets confusing. > In the specific example in this thread, zsh's default array behavior > (no_SH_WORD_SPLIT) is sufficient, but if you later enclose that or a > similar construct in a deeper context, yes, you might be bitten. I'll stay safe. > Your trouble is the definition of "nothing." ${B:#*A*} does that, but > in your example here, you don't actually want "nothing", you want "the > empty string" which is still something. Quite so, rather sloppy of me to say 'nothing', I know better. > About the only thing your magical operator could remove is putting > *...* around the pattern to mean "is a substring". > Well no, I *define* my operator to do just as I said (except that I should have said 'empty string').  All that puzzles me is that it's not already available.  Mind, functionality is added as needed so it's sufficient to just say that nobody has much wanted such a thing -- which is not debatable.  It's a fact on the ground that my operator doesn't exist ergo it's not been in demand and that's that.   So long is my functionality is achievable the rest is just musing.  Still I'd have expected it to be one of the earlier operators because it's the simplest case.  Nevermind.