which and get the following,
brendan$ which python /opt/local/bin/python brendan$ which -a python /opt/local/bin/python /usr/bin/python brendan$ ls -l /opt/local/bin/python lrwxr-xr-x 1 root admin 24 22 Jul 00:45 /opt/local/bin/python -> /opt/local/bin/python2.4 brendan$ python Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) ... (this is the python version in /usr/local/bin)
My point is,
which does not tell me the primary executable, i.e. the one that will be executed in preference. How do I find this out?
I am running OSX 10.6 on a Macbook although the question is general to UNIX-likes.
Update: I have been removing lots of redundant versions of Python on my system (I had at least half a dozen) and removing various crufty
PATH declarations in a bunch of initialisation files. In the process, somehow, a fresh shell now shows the expected output (i.e.
/opt/local/bin/python and that is what is executed). In any case, thanks for the help!