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 1250 invoked from network); 10 Feb 2021 00:51:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Feb 2021 00:51:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1612918309; b=J2Uz2A1z3FU3gjhOKOPUDAlJgcJQhdlfVX0xVh53rkdGo6doiJ4zQ+WGOcqGijTDNp0Wh2PTsW q0KrTuHXzHf1Meu/s8mqIxe8BLVYuEpUMa/YBlP8GpzV/OFULB6zFppEHDoIK/WA2BozyHa1kV nt1tgsykrtK8McileNRSYY8/tQWYr+rmNpXXq8OMXgIFIGxjIjCn8sTpS9zbLKrWcwnzdIRmJ6 N7HVp3cpqvuVvIbDh7QVLkabBLW1r4i58pO3CbeGd8eZqu3jg4UD9RUjyWWkVHyma97xIKK7GR 27V5DWA58jiwo285jlBQ5jU5XrHef29jbhTT68vxbddMkg==; 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=1612918309; bh=4JrwEV/7n/Hod5EU09feE5jxE14g3XRg+BE2z6Wja/I=; 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=lGW+hzmuf3tTc8Nq8snLHvmtOBmZUvY9Ur1H/8HGv/whakd8zIJdCTrjX5bNMi6Zj3yF/HSkQa ho4QS2TmVLQytm/bFBLijXzlkvjWKWTu9YYGBPPmVHV5dBrF43xgV92iPg1cH9Bi/tNBh1+aFu Z9pJmYA5pMT5IU0o0bhLDU+cqJecjXX56NnX1L/xCBP8+EjxSajuvbUA20C/y6iiFc7AiMviu7 v0tJ+8mbJbOmyLztDolVmA+Dh+f/NAlZHV8GgRcQbsSP6bnRy09IN2CoFXGjNkQBArxSF1RDJF 93TfZ3DA/IeF4vY4khwQi5BMcbVFPhwn6ARbaKvmhQb5sA==; 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=QdetDQhtPkk1yuera1ZiHK+zJ5gJxcw2HKiCIUxvWoI=; b=v7MvP54W60QDZzBFoZX4thfZM8 MZZ8sUNNQaIJGvMr3EeWNyboHeC8wLuJSEn9YVrPxDpnxVALmRUnU1ZGsyrwv2bsJQ0o9xQcFYUKd ffyBTy+SJyqgAf1csFRfFL9fxMoTBgGKn7rz5ybPICqpIsUIOj7j87NefIPSV7OFgXfJTx/71ELv3 07Nh48fu0OP0sIfIxOOagGaO5I06xTxlbtHktKY5GMVdPF64rcMiAl5PyE96VlXeLnGENB86toJPC mOJRcjrxhQSnaQrZhYt36U/kcABfWwt6+7sw2Jyay3YqkwVdFAdr+ovGRxi25jUZbb/Zu9U9tl4LW BkoAdv9w==; Received: from authenticated user by zero.zsh.org with local id 1l9djQ-0004yi-M5; Wed, 10 Feb 2021 00:51:48 +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]:54307) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1l9diq-0004bT-Sj; Wed, 10 Feb 2021 00:51:14 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0QOA00KN1DEH7JB0@mta02.eastlink.ca> for zsh-users@zsh.org; Tue, 09 Feb 2021 20:51:11 -0400 (AST) Received: from [192.168.0.3] ([24.207.90.194]) by Eastlink with ESMTP id 9diollQ9UsAqK9diplcRon; Tue, 09 Feb 2021 20:51:11 -0400 X-Authority-Analysis: v=2.4 cv=W6f96Tak c=1 sm=1 tr=0 ts=60232dff a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=W8LDdhElxrQ0Lj09Li8A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheeigddvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeekvdeuuefffefhvdeuieetffdvtddvjeegueejkeeiudehieetieehgeetvdfhfeenucfkphepvdegrddvtdejrdeltddrudelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrledtrdduleegpdhhvghloheplgduledvrdduieekrddtrdefngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg 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> From: Ray Andrews Message-id: <29a203d5-bf53-9cb7-7a49-2705c3b1d8f2@eastlink.ca> Date: Tue, 9 Feb 2021 16:51:10 -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: <52D5DA56-397F-40BB-BBA7-CE3BF7256581@larryv.me> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 26482 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-09 4:22 p.m., Lawrence Velázquez wrote: > For the less clairvoyant of us, your refusal to reveal anything but > the smallest slice of your actual code makes it rather difficult > to help. > I'm trying to keep is as simple as possible because the totality of the thing doesn't matter, just the specific problem.  When a function argument will end up making an argument to grep, and the argument to grep must have single quotes, but the single quotes typed in the function argument are stripped off. What's the solution? grep must have " $ grep 'file name'  " with intact quotes but zsh always strips them off.   There must be a solution.  Or perhaps I'm stuck with " $ grep 'file\ name' -- seems the single quotes preserve the backlash which in turn forces 'file name' to be a single word as wanted.  It's ok, but I wonder if there's a better way.  I thought the (q) flag might do it.  Memory tickles that I learned how to do this once. Hey, just fiddling around with it right now and: $ g ,H 'execute' "'g,46,w4 now default'" f ... double quote the single quotes and the single quotes remain. Logical too, outer quotes will be stripped, so just throw in another set.  Final grep is: GREP_COLOR='01;33' grep --color=always -iFIHn -d skip -- 'execute' 'g,46,w4 now default' f ... all good.