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 18726 invoked from network); 11 Nov 2022 17:25:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Nov 2022 17:25:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668187553; b=ZNJKA8q7jmQFthgY6MU4OnIGl+37w10wXb90ZlVILc2hAeIbm+BZIxRwUDQRQbH0AOIIKfUTzy fnGuyD1lMHYQatoDlpjlSGep748ACBAHP2M5Duoa+K32oR8RzMtZ+D/BzYrchWMSHhT8IQYwhz 6mFRi/sRdVIkDUXD8KjUVWzE7jwgQVxvhxxnNR3f8zxj1vurTVYyelCfSQ+k1XDSAbcaQ865p/ Hjmd6fXdowz4ywZPGAtViy5aN1cEluGTLFMIIP6XRQELKIfaJ8FQ/lM1xyc73iQh97ugHbFdRA uX8qF6ZvWG9G/NGH/NV8FGdaCL+kB/xf0Yl2kGipyg0M8g==; 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=1668187553; bh=9CAt1sUfUvJmJZDQ5wxJuvGRwHTHtn2HCCXB6+fF7F0=; 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=VryH6sxK9wkLKq1sq4Rxq4IzTqp+eDR8Gjvx46rXhh/T5ExQtR9lSON1ptfwRDlF+VZR5D9nlY 5vQX/TtSH15flH7D/fMMP9mDVOz+SVeDAwIpbQB/hC3yWbTly3biiJ68LOHYk2HQk3MgrxH/rD KNhP9ysrvftBLSveAJBCWKjPGqTEi1lmwUvodIlE0SQZub0NCu0+bCSgxBU5bD1BGvy6J0z3R6 0VEnV8hwp4j9racoqY7KM0TUj2nw7/c4zawRJcTqDYxtvPKeFlBjIHSMkYELDL/Do+tH7H7dhY ky09k8H/7r+KECDE/d0sQD/nosz7PKVbTaB5zP/DuoiHKw==; 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=GNCuRJ3pR01cWIvHlJDpJ5idDqB7FC0N5OhqB9epg9s=; b=HShfzqHrXTlvWCiVrXCFj10Inv agUIntSW8TmI5V7ounSXL0Mu6e5w0KHx4QdxD+Obx1HMLuij+fOkQUfBZaeIpFfxiKEsJ8HEnCBwm BRohGS5ggW3SaO0TFuZm3RCtBeox/FUWTkrZj+jaE2Zgjcz1bEbQcQWhSaEnUY2IGuyVW7YGTYWfi ipK5RAUvXadPmSSY+famfMWAxvFsAmVp3IHnjve9Oe6/x0nqmKVGf496oW1zu7NYTp0JdN54uanmO /klmV4j43rKz97SiX92hTNxM18aWoGV3ApQkFHW5KaLS46v06bMixv1CfEPRXXt3cVN1a63YR9Mxq 8sPnrXSg==; Received: by zero.zsh.org with local id 1otXmq-0002P1-Or; Fri, 11 Nov 2022 17:25:52 +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]:46142) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1otXlp-0001iS-U5; Fri, 11 Nov 2022 17:24:50 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta01.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RL700GMB1AXXVM0@mta01.eastlink.ca> for zsh-users@zsh.org; Fri, 11 Nov 2022 13:24:48 -0400 (AST) Received: from [192.168.0.3] ([24.207.18.108]) by Eastlink with ESMTPSA id tXlnoxud0kffJtXlooshYn; Fri, 11 Nov 2022 13:24:48 -0400 X-Authority-Analysis: v=2.4 cv=Lbf6qBTi c=1 sm=1 tr=0 ts=636e8560 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=J06vOifH-nu8sFOAvJUA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfeeigddutdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrfegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <17005577-0b12-dd36-481f-3db889082f5d@eastlink.ca> Date: Fri, 11 Nov 2022 09:24:47 -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: coloring substitution seems to eat next line. Content-language: en-US To: zsh-users@zsh.org References: <549715c2-8b36-8b7e-e3ac-cac02f43dd0f@eastlink.ca> <0a7dbe0d-1554-269a-f420-bfe320c7c838@eastlink.ca> <6d7ba212-be9d-6bb4-f5ce-9a796032ade0@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28371 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-10 13:51, Roman Perepelitsa wrote: > If you look back, you can find in my answers a way to: > 1. Remove all elements of an array that don't match a pattern. It has this form: > > array=(${(M)array:#pattern}) > > 2. Perform a replacement in all elements of an array. Like this: > > array=(${array//pattern/substitute}) > Fabulous:         for filter in "$@"; do             cc=( ${(M)cc:#*$~zsh_case${filter}*} )             cc=( ${cc//(#b)($~zsh_case${filter})/$'\e['$color;1m${match[1]}$'\e[0m'} )         done ... no need for a a loop processing each line one at a time. Once the non-matching lines are removed, the whole array can be colorized in one gulp.  I knew there'd be an elegant way. > You can save a tremendous amount of time by reading the official guide > and the reference. IF you know what you are looking for! I can't look for '(M)' before I know the thing exists to be looked for. > Set aside an evening or two and read them from > start to end. This mortal would need to devote a year to it.  I have tried but one needs to understand the jargon before it's even intelligible. But yes, it needs to be learned from the outside in.  You experts don't realize how steep the learning curve is.  Oh, for a glossary!