From: "Lawrence Velázquez" <larryv@zsh.org>
To: "Ray Andrews" <rayandrews@eastlink.ca>
Cc: "Bart Schaefer" <schaefer@brasslantern.com>, zsh-users@zsh.org
Subject: Re: trivial question
Date: Tue, 06 Dec 2022 01:08:17 -0500 [thread overview]
Message-ID: <72b6f967-ff50-44fc-9cb6-827393353b5a@app.fastmail.com> (raw)
In-Reply-To: <CAH+w=7buxWU3j0WXq3xe7m4c8caMKxfGZb9kqCqx5EjbH6nGWw@mail.gmail.com>
On Mon, Dec 5, 2022, at 11:29 PM, Bart Schaefer wrote:
> On Mon, Dec 5, 2022 at 6:29 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>>
>> I just need to know when zsh is
>> going to attempt globbing and keep on the watch for that.
>
> The cases where it is going to perform globbing are more universal
> than those where it is not.
>
> This is back to the DOS vs. (unixy) shell thing. The command name
> generally doesn't matter. "echo" is not what's deciding whether the
> arguments that follow are glob patterns; the shell itself determines
> that before it even knows what "echo" will do, and that's going to be
> the case for every command.
You can observe this with XTRACE:
% zsh -fxc 'echo [DM]*'
+zsh:1> echo Desktop Documents Downloads Movies Music
Desktop Documents Downloads Movies Music
The XTRACE output (the line beginning with "+zsh:1>") represents
the command that is actually executed. Note that the glob has been
replaced by matching filenames. The "echo" utility does not know
that those arguments were generated from a glob; you might as well
have typed them out by hand.
Compare and contrast with this, which does not use a glob:
% zsh -fxc 'echo DM]'
+zsh:1> echo 'DM]'
DM]
--
vq
next prev parent reply other threads:[~2022-12-06 6:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 2:05 Ray Andrews
2022-12-05 2:52 ` Lawrence Velázquez
2022-12-05 5:20 ` Ray Andrews
2022-12-05 6:40 ` Lawrence Velázquez
2022-12-05 14:11 ` Ray Andrews
2022-12-06 2:12 ` Lawrence Velázquez
2022-12-06 2:29 ` Ray Andrews
2022-12-06 4:29 ` Bart Schaefer
2022-12-06 6:08 ` Lawrence Velázquez [this message]
2022-12-06 10:18 ` Roman Perepelitsa
2022-12-06 11:21 ` Peter Stephenson
2022-12-06 15:28 ` Ray Andrews
2022-12-06 18:53 ` Bart Schaefer
2022-12-07 0:02 ` 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=72b6f967-ff50-44fc-9cb6-827393353b5a@app.fastmail.com \
--to=larryv@zsh.org \
--cc=rayandrews@eastlink.ca \
--cc=schaefer@brasslantern.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).