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

Re: whence (was Re: local unfunction)



Bart Schaefer wrote on Sat, 31 Mar 2018 18:18 -0700:
> The other confusion is that -m never searches $path.  It always
> populates the command hash table if necessary and then searches the
> hash table.
> 
> % path=(./Src $path)
> % whence zsh
> ./Src/zsh
> % whence -a zsh
> ./Src/zsh
> /bin/zsh
> % whence -m zsh
> /bin/zsh
> %

So, -m can lie if 'rehash' hasn't been run since $PATH was last changed?
I'm having trouble seeing why this is useful behaviour.

(Yes, 'rehash' could be expensive, but even so, why does -m give
outdated results as opposed to just erroring out?)



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