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=-5.6 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 18485 invoked from network); 16 Apr 2023 19:26:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Apr 2023 19:26:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1681673161; b=IUMc24ZU/bu3jNrGKHcBTUgIMaPUbHFlP3f1+Bvn8HWkqQiP4NcVbjDTJEddv1p9i/Yu6G/9mW AgPrkiqplOoxwQu5eOjMOd/gNy224spzieKx3Rx/lMVdNQ+oUbDWxdXv7bw7mnRDPq/5XcUQuR Qlr3X9oBxHDkjyZ7ULqXAhks5p/27OrMimdZgDb9Rra3IMyJ+CYfsHrf/5lz8NdkO9L1D2FjPt fhylPx4YYie9NhfmW5KpIcKCqga0gxfwibg2mein/LUbkfS3fzeHvX3g9pIYnYGbitbBlp5KIw /P7A9vtcX55mC9uTUDqUWAPAIyjW5HR3IfZ25zIi9u9CEA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; 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=1681673161; bh=Hgt+4wsuHS7XIO59iePMu3Ci27H8i/5VJu9zGtMauqA=; 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=q4KDooWCYh22woBJKbMfrD9Ss3EEPHTEhJW3kY7s7rPfR/49EnAx394wds5YsBFmIRUasKVXr0 9sJUU0hjTZQynHHxurByo30h81uBRQ6wjhI+yIHGmeHjma+37hXsuNTfW/GgvpCfs8iyRMzmOM x6J2Ps+vZH2RCU+7/kMRWXpcDU82d7P3iQkuz/vbwukegvA8InsoCn3f9HgPjbyYdBCOx31fKP rJ69h2iXiWv23/CySWPqBdXKm5hE4WdYjfBDV0GoqLQnb0iRqE+HPU2R7P+o8vNBuRkm+bu99s U9dNV89vhTuzcWl6w2BMav8Rz5w3nL89vcv3xOJB0GcLhA==; 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=0jzXwVYn5aiMXrPEFGHVHBUPLIHpBXsisnfxizhKS4k=; b=iTDWb+WBs36Mv1P5YRGkClZTPY CsXBLhnGgdmRsgZx07291D3kp7xL66KVZ8vJ6r2xGaDMAqdhhp6H+aCrImefPhWg4P5hhxkfSHcg5 mLTzS5ve6BPlIOALbt2fxUXZnvBWUZ/ZbwJKyvV/+DJ42Uvx4WX64ch+wV+sMZfZ5o5Sje5rt90RQ kONl/2oBPYnV1TEp3bdYwnlQXbXEm6vjsdGb8hgSTGr0IrjG8Slbp0udzCFxCwuwQIViUvc4jKwhG G6MhjZwErHoLaI91n9RaMF8tAqvWbSXukznngkT1yPjHTetqsP/ZWKZmi+zJd48KX4Ih3AcWf1hiv 6ZJRibPQ==; Received: by zero.zsh.org with local id 1po80e-000LNO-G6; Sun, 16 Apr 2023 19:26:00 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:53276) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1po7zY-000Kfo-FC; Sun, 16 Apr 2023 19:24:52 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca ([24.224.136.10]) with ESMTPS id <0RT8008KV1F14920@mta04.eastlink.ca> for zsh-users@zsh.org; Sun, 16 Apr 2023 16:24:51 -0300 (ADT) Received: from [192.168.0.4] (host-24-207-18-108.public.eastlink.ca [24.207.18.108]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id o7zWpAOH4S9Eko7zXpj5sz (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sun, 16 Apr 2023 16:24:51 -0300 X-Authority-Analysis: v=2.4 cv=BY8ekJh2 c=1 sm=1 tr=0 ts=643c4b83 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=F5y3INqXqQ3vUNKgEn0A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdelgedgleehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <3630cc6b-0f1e-7579-4e19-a6c8c366b69e@eastlink.ca> Date: Sun, 16 Apr 2023 12:24:50 -0700 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: "Pull just the text of a single command" (was Re: .zsh_history) Content-language: en-US To: zsh-users@zsh.org References: <81609CF4-42DA-4E0F-A6E5-C5D58578B4F7@easesoftware.com> <9a1f77ea-ee4e-95ff-a571-5cd3ddce6cb2@eastlink.ca> <8b0f0941-5212-5268-1f9d-d7542990439a@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 29039 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 2023-04-16 08:53, Bart Schaefer wrote: > chain=( ${(s:; :)${(z)1}} ) in preexec (): chain=( ${(s:; :)${(z)1}} ) print -lr $chain try it: 0 /aWorking/Zsh/Boot 1 $ echo *; echo howdy; echo $path; echo $path > nowhere; echo "Now is the time" | grep 'time' echo * echo howdy echo $path echo $path > nowhere echo "Now is the time" | grep 'time' ... so that's about it.  I'm not going to be throwing anything more troublesome at it than globs and variables and redirections and pipes, and those are remaining as raw text so that's fit for purpose.  Only thing that would break it is chained commands which isn't really a problem.  However, even there, I can't help but notice that if there was a way of matching each one of the chained commands to its appropriate member of the array, then even that would be solvable.  Some sort of counter for each one of the chained commands?  'echo $path' is command #3 above so its match is $chain[3] and its tail is '$path'.  Easy.