How can I find all copies of an executable name in my PATH?
I think this should work:
IFS=:
for dir in $PATH; do
if [ -x "$dir/$1" ]
then echo "$dir/$1"
fi
done
type -a *
For example,
type -a python
gives
python is /Users/user1/anaconda3/bin/python
python is /usr/local/bin/python
python is /usr/bin/python
python is /Applications/CASA.app/Contents/MacOS/python
Try this builtin command:
which -a python