On 1/7/10 5:30 PM, Giuseppe Scrivano wrote:
> the code I have attached is just a test case that actually, AFAICS,
> can't be fixed without change its code. This situation can be present
> in a shell script that potentially can rely on the PATH elements
> precedence.
>
> Is there a way to disable commands hashing at all? I couldn't find it.
There is. Look at `set -h'.
Since this only happens when you run a command found using a PATH lookup,
causing it to be hashed, then explicitly create a command of the same
name and install it in another directory in PATH, I recommend that you
run `hash -r' after you install the second command. This will avoid the
problem while retaining the benefits of hashing.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/