Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: whence output varies with dot vs. realpath in $PATH

On 2022-10-31 14:18, Bart Schaefer wrote:
On Mon, Oct 31, 2022 at 7:57 AM Ray Andrews <rayandrews@xxxxxxxxxxx> 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

Thereyago, I'll kill that trailing colon.  Still, it seems like something that should be ignored.

Messages sorted by: Reverse Date, Date, Thread, Author