My $PATH has /a/path/with spaces/in/it
I can run executables that sit on said path by simply typing their names.
But when I attempt to apply commands on them, they fail with can't be found error.
eg. I have a python script on the path, called prog.py
If I just type prog.py, my shell attempts to run it. So the path is working. But:
$ python3 prog.py python3: can't open file 'prog.py': [Errno 2] No such file or directory $ file prog.py prog.py: cannot open `prog.py' (No such file or directory)
If I cd to the actual location of prog.py, then attempt the same commands, they run as expected:
$ file ./prog.py ./prog.py: Python script, ASCII text executable $ python3 ./prog.py True
Why does this happen? And what can I do to execute these commands (particularly python3) from wherever I wish?