From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: whence output varies with dot vs. realpath in $PATH
Date: Mon, 31 Oct 2022 15:59:09 -0700 [thread overview]
Message-ID: <1f246a94-944c-cbc3-27af-43a34b90151d@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7b5=2grjnNWPGCUFYavAS5+JiMpnhOM7+KfnEJLi565CA@mail.gmail.com>
On 2022-10-31 14:18, Bart Schaefer wrote:
> On Mon, Oct 31, 2022 at 7:57 AM Ray Andrews <rayandrews@eastlink.ca> wrote:
>> It's the -m option. If you ask for a pattern match, "whence" rebuilds
>> the internal command hash table from the path and then does the
>> matching against that. However, "." is never used when loading the
>> hash table because it would become invalid as soon as you change
>> directories. If $PWD is actually in the path, then those commands DO
>> get put in the hash table, so whence reports them.
That can be in there literally? I'll try that. But wouldn't the same
reasoning apply as with dot? Anyway I get the point, you can't rehash
at every directory change.
> This should
> probably be clarified in the documentation -- whence never does
> globbing on actual file names.
>
> You don't see this as a persistent condition because you're running
> "whence" in a subshell with $(...).
>
> The "zsh is zsh" output means you have an empty path element, e.g. two
> consecutive colons in $PATH or $PATH begins or ends with colon, and an
> executable or link named "zsh" in the current directory.
>
> 2 /aWorking/Zsh/Source/Wk 1 $ echo $PATH
> /aWorking/Zsh/Source/Wk:/usr/local/bin:/usr/sbin:/usr/bin:
>
Thereyago, I'll kill that trailing colon. Still, it seems like
something that should be ignored.
next prev parent reply other threads:[~2022-10-31 22:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 13:30 Ray Andrews
2022-10-31 13:43 ` Roman Perepelitsa
2022-10-31 14:06 ` Ray Andrews
2022-10-31 14:10 ` Roman Perepelitsa
2022-10-31 14:32 ` Ray Andrews
2022-10-31 14:36 ` Roman Perepelitsa
2022-10-31 14:57 ` Ray Andrews
2022-10-31 21:18 ` Bart Schaefer
2022-10-31 22:26 ` Bart Schaefer
2022-10-31 22:59 ` Ray Andrews [this message]
2022-10-31 23:03 ` Bart Schaefer
2022-10-31 23:17 ` Ray Andrews
2022-10-31 23:21 ` Bart Schaefer
2022-10-31 23:14 ` Lawrence Velázquez
2022-10-31 23:21 ` Ray Andrews
2022-10-31 23:38 ` Bart Schaefer
2022-11-01 0:03 ` Ray Andrews
2022-11-01 0:31 ` Bart Schaefer
2022-11-01 0:55 ` Ray Andrews
2022-11-01 1:08 ` Bart Schaefer
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=1f246a94-944c-cbc3-27af-43a34b90151d@eastlink.ca \
--to=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).