On 11/05/2014 09:49 AM, Oliver Kiddle wrote:
Ray Andrews wrote:... yet, although '/usr/local/bin/zsh' is found, all of the other files found by 'whence -a zsh' above are missed. How is it that '/usr/local/bin/zsh' matches 'zsh*' but '/bin/zsh' does not?Because /bin/zsh is hidden by /usr/local/bin/zsh. The commands are in a hash table and there is only the one entry for zsh. Looking at the source, it seems that whence doesn't support both -a and -m together though it doesn't produce an error.
You anticipate me. '-am' was the first 'cure' I tried.
I'm not sure what the intuitive answer might be. As Peter said, '-m' finds only the first *active* match, whereas '-a' pointedly keeps looking. Perhaps '-a' might accept wildcards? That would leave '-m' alone, but expand the usefulness of '-a' without (I hope) breaking anything.I'd agree that this isn't ideal. Note that whence -m does show a zsh alias in addition to /usr/local/bin/zsh if there is one.