From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: protect spaces and/or globs
Date: Wed, 10 Feb 2021 16:29:00 +0000 (GMT) [thread overview]
Message-ID: <379883051.3731455.1612974540761@mail2.virginmedia.com> (raw)
In-Reply-To: <b7d8846e-6c5e-ed31-852a-23bcb6f670c4@eastlink.ca>
> On 10 February 2021 at 16:19 Ray Andrews <rayandrews@eastlink.ca> wrote:
> On 2021-02-10 7:47 a.m., Peter Stephenson wrote:
> >
> > No eval needed, the arguments are now exactly the correct command arguments.
> >
> If you look at this one case indeed no eval is needed, but in the
> broader context of the way all
> my functions work, the eval is unavoidable. Or is it? Maybe not.
As always, that depends what you're actually doing, which is a superset of
what you're telling us you're doing, but in general it shouldn't be a problem
--- unless you know you need an extra set of expansions, it's possible to
prepare the arguments you need in the array to be executed as a command
line.
What I mean is, the cases where this *wouldn't* work would be like this...
fullargs=(some stuff '$to_be_expanded_later')
So somewhere down the line you're going to assign to to_be_expanded_later,
and you want that to be expanded when you execute the command line.
*Now* you need the extra eval. But if you're not doing anything like
that, you've just plain old command line arguments and no eval is needed.
pws
next prev parent reply other threads:[~2021-02-10 16:29 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
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 [this message]
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=379883051.3731455.1612974540761@mail2.virginmedia.com \
--to=p.w.stephenson@ntlworld.com \
--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).