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.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 14758 invoked from network); 10 Feb 2021 20:54:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Feb 2021 20:54:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1612990464; b=Zh88AI8L6pNoIb3C/kqg/x9XLBnsaR/FEtm8OLFrI8Af9BswcjQjxmtjKVwAof1wyui6rmHaux 9jq33R2jyjplDtyZBy/8ap/a8FkBXR15OPQ3Ziv3Sw6WuJ4McfE3iful01KClUsI1RuXa3ZS0l aqBG3NaFNSkeAnzwOha+KWPgy6v4OFJl/4jj2t6X+M+GfaBtVDutPGdvtDDBMkbmY103QNhJhd rbWNGu2MmVqV29T0prZ27TmOO36SH3zNDt/pnF4aTr/hjCjqPayb5kohZ6RYPsbrRTmbteecGJ ujOuIXhYzdy1cWQBT3+evjcBBHnbk9aLw2J1Y9b8bhAgNA==; 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=1612990464; bh=TAY5ry34mqR9WICGLT0xO1mnYJzJ1TC78ZqBIfyWT6M=; 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=C1C3NFa/w23cNgMt/0FzHBcWPEPqdzxK9uHcrycj8wltKNuOLF28/hp+Pcn1RoKIwtUEWef0/H Qu1c03lJpOnz8Qz//0Ut6Q96Y5OSP2M7AYVEdx0wD7NjOzkEX8mfjFCdH9nA2h5m59/fBvx3MB WMzjRgJfS7VQ/lPLEbVy16878+bqhWHdsurWWiBunQvitNTSbOm53hM6Ps96r8l3KumwNlgOG7 UBrcPNtB7BsCrdII8KnzHjAwNIgEC+wR8nhj1rjnad8Kg4ZARiqx2OybEtp9XT0sFxRBGCd6qT 9Lr4oqRHVGX0Z4NLtdfCQLEEfuFLEDNOYcNzB6KjGm4LKQ==; 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=p8Y/JgyN9PPZyYvQ6p7+5UvhpHGHN7k6D8DQxobnOhg=; b=ZvCJ+8jiFqOgj2Omoz2GdxV3uD ezJrVvYqHSVL/J9GQSDJWja5cm/ScmQR8rhM+QhNXKcvCpD9XSv06jyRNc0vfVm8REIJF6Je7EQc7 GeSN6eHJ8eqj3AvmTPSyN27K7iUYBMnhV8kmOwvJIQmH6qSfF0dzkwOUa+FOyrdJp8tffsYiAiPfd /5632rhcptOENFIpgTSnbFKjJ6n/GXJMxpp3iEBdSsc8PruPrlVnpqZ2PTbYAb4fWedSN1SOSfkAJ PrnEeiwe+kBoEeqRjiOIqWsD6EvNWclhT97sXNURaAEO3mx8P+hYqrzFQCCMFxP4wpa5a0TzJ2szT tG5Us+YA==; Received: from authenticated user by zero.zsh.org with local id 1l9wVC-000LZ3-TX; Wed, 10 Feb 2021 20:54:22 +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]:46390) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1l9wUj-000LC4-Hh; Wed, 10 Feb 2021 20:53:54 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0QOB00KZSZBN4F80@mta02.eastlink.ca> for zsh-users@zsh.org; Wed, 10 Feb 2021 16:53:50 -0400 (AST) Received: from [192.168.0.2] ([24.207.90.194]) by Eastlink with ESMTP id 9wUblTOjcnkRC9wUblZwJj; Wed, 10 Feb 2021 16:53:46 -0400 X-Authority-Analysis: v=2.4 cv=B+J8bMhM c=1 sm=1 tr=0 ts=602447da a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=c1hHHl6wYOPGsscGae0A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheejgddugedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepkedvueeuffefhfdvueeiteffvddtvdejgeeujeekieduheeiteeiheegtedvhfefnecukfhppedvgedrvddtjedrledtrdduleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdeltddrudelgedphhgvlhhopegludelvddrudeikedrtddrvdgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: protect spaces and/or globs To: zsh-users@zsh.org References: <52D5DA56-397F-40BB-BBA7-CE3BF7256581@larryv.me> <29a203d5-bf53-9cb7-7a49-2705c3b1d8f2@eastlink.ca> <87a6sc3d0c.fsf@lwm.klanderman.net> <752329601.3729797.1612972051119@mail2.virginmedia.com> <379883051.3731455.1612974540761@mail2.virginmedia.com> From: Ray Andrews Message-id: Date: Wed, 10 Feb 2021 12:53:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-version: 1.0 In-reply-to: <379883051.3731455.1612974540761@mail2.virginmedia.com> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 26498 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-02-10 8:29 a.m., Peter Stephenson wrote: > > As always, that depends what you're actually doing, which is a superset of > what you're telling us you're doing, It's hard to put it briefly and still accurately.  I went down a certain path when I first got involved and it might not have been the right path nevertheless it has a certain power.  My wrappers evolve and evolve with more and more filtering and coloring and columnizing and massaging and end up with some monstrous actual command strings to execute.  By being able to recall the actual command, I can edit it to find some bug very quickly.  My function assembled: " grep-i -- arg arg " when what was wanted was: " grep -i -- arg arg " . Once I know where the bug is, I can figure out where it came from in my function very quickly.   So I assemble my string, save it to history (optionally) and then eval it to fire it off.  Up arrow, and voila!  I have the guts of what my function did, available to tweak.  So: 9 /aWorking/Zsh/Source/Wk 3 $ l ,H l,* LISTING of "l,*": all file types, INsensitive. Sorting upside down by: Mod. Time:  11434 [2021-01-07--08:49] l,6,NO H  10516 [2021-01-07--08:49] l,4,BUG and case now insensitive ...  15988 [2021-02-03--20:06] l,51,colorize all matches if leading wildcard  15614 [2021-02-04--16:34] l,52,bug with totals Items found: 52 Total bytes in this directory: 3.5M Total including subdirs: 16M ... and how did that actually happen?  " ,H " orders a write to history so up arrow and: 9 /aWorking/Zsh/Source/Wk 3 $ ls -AFrGgdt --time-style='+[%F--%H:%M]' --group-directories-first --color=always  (#i)l,* 2> /dev/null   | sed -r "s|^(.{10} {1,2}[[:digit:]]{1,2} )| |"  | egrep -v '^total' | egrep -i --color=always "^|] l,*"                      | sed -r "s/\x1b\[01;31m\x1b\[K\] /\] \x1b\[01;31m\x1b\[K/g" ... that's the actual guts of the thing.  No, I'm not insane, I just like color, prefer to remove all the permissions stuff since it it irrelevant to me, etc.  But the whole show requires the whole command to exist as a string so it can be saved and thus it needs 'eval' to fire it off ... unless I'm mistaken. If that makes any sense.  It all works quite fine but there are these quoting issues now and then.