2011年12月12日 星期一

BASH: How do I clear Bash's cache of paths to executables?

BASH cached the searched path of the executables??!! , WTF....

# xxx.sh
xxx.sh: command not found
# touch /bin/xxx.sh
# chmod +x /bin/xxx.sh
# xxx.sh
# rm /bin/xxx.sh
# xxx.sh
bash: /bin/xxx.sh: No such file or directory

How do I clear Bash's cache of paths to executables?
http://unix.stackexchange.com/questions/5609/how-do-i-clear-bashs-cache-of-paths-to-executables
bash does cache the full path to a command.
To clear the entire cache:
hash -r
Or just one entry:
hash -d svnsync
More info in help hash and man bash .

沒有留言: