Red Hat Bugzilla – Bug 126425
If command moved to different place on path, bash says file not found
Last modified: 2007-11-30 17:10:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040608
Description of problem:
When I install a binary in a different place bash can't find it any
more, even though it's still on the PATH.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a dummy script in /usr/local/bin/dummy
2. Run dummy
3. mv /usr/local/bin/dummy /usr/bin
Actual Results: bash: /usr/local/bin/dummy: No such file or directory
Expected Results: Should have run the script from its new location
Workaround: type hash -r
Reported upstream. This behaviour has been there ever since I
remember -- I thought it was intentional for some reason.
Upstream maintainer says:
That's what the `checkhash' option does. Since POSIX mandates this
behavior, it happens when bash is running in posix mode, too.