You are not logged in.
Hi,
I wrote a simple command line phone book. I'd like it to work so when I type into the shell "phone Jerry Johnshon" I get Jerry's number for example. I wrote the program in Python as a python script that takes the name as an arguement. However right now I have to set up a bash alias to /path/to/script/phone.py so I can call the "phone" alias. I'd like to do that in a more elegent way, simular to how Mplayer can be invoked by typing Mplayey [file]. I was wondering how can I achive that effect?
Offline
put this in your ~/.bash_profile:
PATH=/path/to/script:${PATH}
This won't take (automatically) effect take effect until you log off and back on. If you want to test it before that, just type this in a terminal:
source ~/.bash_profile
EDIT:
Oh, and name your file /path/to/script/phone (without the .py extension), chmod u+x it and put this at the top of your script:
#!/usr/bin/env python
Last edited by klixon (2009-09-25 18:02:36)
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
You could also move it to a place that is in your $PATH. Note that the directories in that list is often only writable by root.
I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.
Offline