zsh-users
 help / color / mirror / code / Atom feed
From: "Lawrence Velázquez" <vq@larryv.me>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: protect spaces and/or globs
Date: Tue, 9 Feb 2021 21:52:19 -0500	[thread overview]
Message-ID: <7A1E233A-5644-4511-9434-176345006E39@larryv.me> (raw)
In-Reply-To: <1aec7108-8a44-8866-1db3-7d93f614582f@eastlink.ca>

> On Feb 9, 2021, at 9:25 PM, Ray Andrews <rayandrews@eastlink.ca> wrote:
> 
> On 2021-02-09 5:46 p.m., Lawrence Velázquez wrote:
> 
>> ... which youhave already decided is an ulcer and cannot possibly be anything
>> other than an ulcer.
> It would take far too long to explain the whole show.  If you have the time and interest
> contact me privately and I'll show you what I'm up to.  But I already waste far too much
> of the list's time.

Au contraire.

https://www.mikeash.com/getting_answers.html#provide

>> % () { eval "print -rC1 -- ${(q)@}" } a 'b c' d 'e f g'
>> 	a
>> 	b c
>> 	d
>> 	e f g
>> 
>> 
> Thing is that if those args were going to grep and they were filenames you'd end up with:
> 
> $ grep [some search string] a b c d e f g

No. This has nothing to do with grep and everything to do with how
you assemble the eval argument.

% () { emulate -L zsh && eval "grep ${(q)@}" } pattern 'file 1' file2 'file the third'
grep: file 1: No such file or directory
grep: file2: No such file or directory
grep: file the third: No such file or directory

--
vq

  reply	other threads:[~2021-02-10  2:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 20:42 Ray Andrews
2021-02-09 21:05 ` Lawrence Velázquez
2021-02-09 21:08 ` Peter Stephenson
2021-02-09 23:45   ` Ray Andrews
2021-02-10  0:22     ` Lawrence Velázquez
2021-02-10  0:51       ` Ray Andrews
2021-02-10  1:46         ` Lawrence Velázquez
2021-02-10  2:25           ` Ray Andrews
2021-02-10  2:52             ` Lawrence Velázquez [this message]
2021-02-10  1:52         ` Greg Klanderman
2021-02-10  2:29           ` Ray Andrews
2021-02-10 15:18           ` Ray Andrews
2021-02-10 15:47             ` Peter Stephenson
2021-02-10 16:19               ` Ray Andrews
2021-02-10 16:29                 ` Peter Stephenson
2021-02-10 20:53                   ` Ray Andrews
2021-02-10 22:14                     ` Bart Schaefer
2021-02-11 16:31                       ` Ray Andrews
2021-02-11 17:19                         ` Lawrence Velázquez
2021-02-11 19:48                           ` Ray Andrews
2021-02-10 18:08                 ` Bart Schaefer
2021-02-10 20:56                   ` Ray Andrews
2021-02-10 16:28             ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7A1E233A-5644-4511-9434-176345006E39@larryv.me \
    --to=vq@larryv.me \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).