This question already has an answer here:
After creating a Python script file, test.py, in my home directory, and running
chmod +x test.py to make it executable, and placing
#!usr/bin/env as the file header, I expected to be able to run the script from
bash on OS X, using:
-bash: test.py: command not found
The following command worked:
Why is the relative path required for this executable script in the present working directory?