Re: bash tries to execute not existing binaries
Hell,
* Cajus Pollmeier (C.Pollmeier@gmx.net) wrote:
> Hi!
>
> Not a big problem, but I'd like to know if there is a better solution for
> that:
>
> I had a self compiled binary "/usr/local/bin/blah". Another version of this
> binary is in "/usr/bin/blah". The bash path is set to take the one from
> /usr/local first, executing it works fine.
> After deleting /usr/local/bin/blah, the bash tells me "/usr/local/bin/blah no
> such file or directory" after typing "blah" at the prompt. Using a new
> terminal solves this problem.
> Is there a more elegant way to "rehash" the binary paths?
Try settin the `checkhash' option of bash:
shopt -s checkash
So bash will look in the path each time the hashed program is
not found.
You can also type:
hash -r
That will clear the hash table used by bash.
> Thanks,
Bye
--
DEFRESNE Sylvain
Reply to: