[PLUG] Way to disable command hashing in bash?

Kulkarni Shantanu linux at shantanukulkarni.org
Sat Apr 10 20:57:16 IST 2010


* Mayuresh <mayuresh at acm.org> [100410 19:58]:
> Now the "solutions" I know and am not particularly happy with are:
> 
> 1. Use hash -r to remove the cache.
> 
> 2. Open a new session every time you check out, so that you begin with
> empty cache.
> 
> 3. Write a script for check-out operation that will empty the cache.
> 
> Rather, I am looking for a way that will disable caching completely and I
> won't have to remember to do any manual operation if I check out the
> program.
> 

I do not have an exact answer, but have thought of aliases.
You may want something on lines of,
alias cmd=/dev/cmd
This will ensure /dev/cmd is executed always. But do read this before,
http://www.gnu.org/software/bash/manual/html_node/Aliases.html#Aliases

Even functions might do. Please see,
http://www.gnu.org/software/bash/manual/html_node/Command-Search-and-Execution.html#Command-Search-and-Execution

I do not have access to bash 4 and so cannot find the exact solution.

Do keep us posted on results.

Shantanu
www.shantanukulkarni.org
-- 




More information about the Plug-mail mailing list