[Tutor] Making a script part of the terminal

Timo timomlists at gmail.com
Fri May 20 20:00:53 CEST 2011


On 20-05-11 19:43, michael scott wrote:
> Okay, my title might be undescriptive, let me try to explain it 
> better. I want to take a script I've written and make it usable by 
> typing its name in the terminal. Perfect example is the python 
> interpreter. You just type in the word python to the terminal and then 
> the interpreter runs. I know other programs can do this as well (like 
> mozilla or nautilus or rhythmbox).  So how do I make my scripts 
> executable from the terminal?
I can only speak for Linux, but your script should be in a directory 
that is in the PATH variable of your environment. The reason why you can 
just enter a program name in the terminal, is because these should be in 
/usr/bin or /usr/local/bin and these are in PATH.

Type this in the terminal to see which ones:
echo $PATH

You can either put your script in one of those directories or add on to 
PATH.

Cheers,
Timo

> ----
> What is it about you... that intrigues me so?
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list