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

Re: 'whence' anomaly.



On Mar 24, 11:19am, Ray Andrews wrote:
}
} What causes this:
} 
} >     $ whence -m mplayer
} >
} >     $ whence mplayer
} >     /usr/bin/mplayer
} >
} >     $ whence -m mplayer
} >     /usr/bin/mplayer

I guess you could think of it as both/either a bug and/or a feature ...

"whence -m" searches, but does not populate, the command hash table.
Thus if the NO_HASH_CMDS option is set, "whence -m" does not work
at all. [*]

"whence" populates the hash table as a side-effect of searching $PATH,
presuming HASH_CMDS is set; but it might not fully populate the table
if HASH_DIRS is set, so "whence -m" of a different command from later
in the $PATH might still fail.

[*] Except that the CORRECT option also relies on the hash table, so
if that is set, as soon as anything might need correcting, the table
gets filled, and "whence -m" will start working again.



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