I have a script.py that I'd like to run when the user types "script" in unix. How do I accomplish this, instead of forcing him to type ./script.py each time?
2 Answers
You need to put the directory of the script in your PATH environment variable.
e.g.
/path/to/script.py
export PATH=$PATH:/path/to
To obviate typing the extension create a local symlink
ln -s /path/to/script.py /path/to/script
This prevents polluting /usr/local/bin with manual symlinks (which could be important on a multi-user) system.
1 Comment
pydsigner
That doesn't take care of the extension.