[Gloucs] Odd shell behaviour...

Thomas Adam thomas at edulinux.homeunix.org
Thu Jan 6 15:52:36 GMT 2005


On Thu, Jan 06, 2005 at 03:45:56PM +0000, Mick Brooks wrote:
> That seems to have fixed it (as well as forcing me to learn something
> new about bash :-).
>
> $ type gv gv is hashed (/usr/bin/X11/gv) 
> $ hash -r 
> $ type gv gv is hashed (/usr/bin/gv)

For those of you playing along at home (heh), here's the reasons why
this happened. Bash remembers commands that you execute (external
commands located via $PATH -- not bash builtins), in a hash. So that
when you type in the command again, the hash is used to determine that
path to the application used before.

But what it won't do explicitly, is recheck it. So clearing the hash
forces the lookup to happen afresh, thus finding the correct path. Quite
what 'gv' was doing in /usr/bin in the first place, is unclear. It's not
policy for it to reside there.

> Thanks for your help, it's much appreciated.

You're welcome.

-- Thomas Adam

-- 
I know nothing, and understand even less.



More information about the gloucs mailing list