LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bash and path issue (https://www.linuxquestions.org/questions/linux-software-2/bash-and-path-issue-925448/)

chiendarret 01-24-2012 08:33 AM

Bash and path issue
 
Attempted running of "filename.py", having "#!/usr/bin/env python" as first line, by commanding "filename" from inside a subfolder of /usr/local failed with error

bash: filename.py: command not found.

I had to command either "python filename.py" or "./filename.py" in order that the python program executes.

Question: how to fix "bash" in order that the directory from where the command was issued is on my path?

thanks, chiendarret

eSelix 01-24-2012 08:51 AM

Create this file in folder where by standard system searches for execute, so: "/usr/local/bin" or "$HOME/bin" if this is added to your PATH. Eventually add this directory to PATH environment variable. For example
Quote:

export PATH=$PATH:/additional/path
But the first method is preferred.

David the H. 01-24-2012 09:31 AM

Your shell will only execute commands that have a clear absolute or relative path prefixing them, or are in a directory defined by your $PATH variable.

Permanent modifications of PATH are done in your shell start-up scripts. See the INVOCATION section of the bash man page for a description of which files it loads when starting on your system.

chiendarret 01-25-2012 01:13 AM

Thanks


All times are GMT -5. The time now is 04:02 PM.