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.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30057 invoked from network); 14 Sep 2022 20:07:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Sep 2022 20:07:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1663186064; b=lSWjCX/LyvkUEmW1SAjOOUOgHqXXKZfGPRNwBugqxA8U/XWRi3RALwICUIzOki2TsUzn1rOkXZ ymQPoXVFkXM44B2uhP9zcxYHFNnXrldeLMUHeNHMmIx0qdI6ksuRgP2jCo8rn1Dtf3cmIH8tqA eloP5j9SIpi+R4149JH5Wxb5Oo+bYaxvZCysY/Mv/ns8D6HbgeweBGQgQdhDuKDibZzHEPvuHZ I3Ik5RnWdUMMVS93YiV5KRze9ulBlKtYiRpGqasTRpyO+lcIuH+SxdEu8VvpmOP6QEgnUBOI5S utdS68Boy7s2nRIRpgxuUWfAwsw1CJaah7iPLOfvfCWDQw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; 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=1663186064; bh=ZUyX/rMSpHK00FKM8bQZHOk2viHHwO5j7zCFU17HqM8=; 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=amE+ZSryzg08DI68dXCGnuJ7L7LpLfQTEvqNzR/VCqFDWBKcoeykSX93e5zRdgQdC6H4qNrPBm ofaefpuUkUSXYXGNvbkljNFLRZym4epdwwp1TcVKoqwwuGXhDkw2b1SQk1IR7zzZ0H2oOaRgoA +/HV7HDZAIL9kTaVh/rTK/mr9CG6+WMtdu+UwaeVYeR/z02zLitx0kWSqWSefKzSqhHqsM7Ylh ykHyiQ6zgdRmeXVZQ6CHrnRDY3Sq60koKZEHjNyDRzMH1OFb/IhAMVuIfqrzfXbsNzTRZPricO nFJRgGZ3SOTjONgOMBv35cPGhDxtfl6NUxf/DZn73TV/iw==; 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=6NrYUdcwx9jU5RAAVisIu49+Efn2POL+vnU82pMg5oI=; b=aE07UBuBGOdj7mbWLL931L623/ Wyqt4LhLQJ+CFbt36mIwe4q9PuP9cx6kfl0ZPoZRta/n8XBF9lHXvE6JLtniXh1gACM3DD+i0MxVy udlz3dYGrBwW7smw26dkwGITYWR33vU++LKVEp/4SJsrdQXUn+W5ggjUL3FRvVX8gZokWIGztqFet VAfMJD7lfpWrmMayjxn+/mrL9z5Re4nJqxHaxPOLLz8vRbzMaIC5QzUTlTmJRAEdaGbKJEpr8zPBE bxuvF3IBUWNiNkYshx5TC0CtMgb3T4unLvkTUitVukgXaGlOeAC0BM0UGFRU6QXSCAWYuz0RTHlZs F+LVAVpw==; Received: from authenticated user by zero.zsh.org with local id 1oYYfe-0001OM-Kc; Wed, 14 Sep 2022 20:07:42 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:54251) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1oYYeO-0000hA-HC; Wed, 14 Sep 2022 20:06:25 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta01.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RI7006TRT3NZGV0@mta01.eastlink.ca> for zsh-users@zsh.org; Wed, 14 Sep 2022 17:06:22 -0300 (ADT) Received: from [192.168.0.2] ([24.207.18.108]) by Eastlink with ESMTP id YYeLotJuHVmS3YYeLor6ls; Wed, 14 Sep 2022 17:06:22 -0300 X-Authority-Analysis: v=2.4 cv=S4EcfKgP c=1 sm=1 tr=0 ts=6322343e a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=-wwYurIXdkh8ykKHBWAA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeduiedgudegkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrddvngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepuddprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.18.108 Message-id: <492e0562-1666-fad9-bd95-31cbf2721c3a@eastlink.ca> Date: Wed, 14 Sep 2022 13:06:21 -0700 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Substitute the last match of a pattern during parameters expansion. Content-language: en-US To: zsh-users@zsh.org References: <4844b850-2ca6-4c90-95ae-aae00dc339cf@www.fastmail.com> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28072 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-09-14 11:56, Bart Schaefer wrote: > On Tue, Sep 13, 2022 at 8:20 PM Michele Venturi wrote: >> Plus you seem quite good at non trivial tasks if you can >> write that monstrousity... Do you know instead what IS trivial? Counting, to know how many matches there are. > Definitely keep using that approach, and see how much help it gets you > in future. Really.  I might bitch about some aspect of the shell but I'm not going to whine about the prompt, knowledgeable and unfailing help I get here, that's for sure.