TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash tip...hashing
<bash tip>
If you're using bash, it hashes all of the commands you execute from the shell.
For example, we have 'ps' in both /home/chewie/bin (shell script wrapper) and
/bin (system executable). We've executed the wrapper but decide we don't like
it, so we move it or remove the symbolic link pointing to /home/chewie/bin/ps,
and try to execute 'ps', expecting the system executable to be used. Instead
we get some error saying that /home/chewie/bin/ps cannot be found...
To fix this, we type:
$ hash -r
...to remove/wipe the hash table. If you type 'hash' previous to wiping it,
you will see the entry for 'ps' in the stack.
</bash tip>
And now back to your regularily scheduled programming...
--
^chewie
PGP signature