A Weird Imagination

Which command will be run?

Posted in

The problem

While trying to develop a modification to the Pelican source, I was unexpectedly having my installed version of Pelican get run instead of the local version:

$ which pelican
$ command -v pelican

For some reason, which was pointing to the executable I was expecting bash to run, but the Bash builtin command was telling me that bash was running the installed version instead.

The solution

Use the hash builtin to clear bash's cache of the location of pelican:

$ hash -d pelican
$ command -v pelican

Read more…