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

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



On Mon, Oct 31, 2022 at 2:18 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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.

There's one additional thing going on.  When you use BOTH -a and -m,
then anything found in the hash table with -m is searched for AGAIN by
-a, using the name as found in the hash table rather than the pattern
supplied as the -m argument.   This is why "zsh" shows up multiple
times but your garbled-name scripts do not.




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