I am executing on a Ubuntu 12.04 shell the following command:
sudo bash -c "echo $PATH; which python"
which displays something like
and the following command
displys (amont others)
According to the
man pages the
which command looks for the given executable in all paths defined in
man page does not strictly specify the 'order' of the search, but usually it goes from the start to the end of the
PATH environment variable.
Now, the path
/home/me/env/develop/bin contains a python executable (modes set correctly, not a symbolic link), which is also the first path in
PATH. But the
which command displays a completly different location!
Why is that? I am doing something stupid? Has it magically to do with
sudo? Is this a bug?