PDA

View Full Version : adding a file to my path




jamesapp
Jun 7, 2008, 12:05 PM
i have a shell script in a directory on my hard drive.
it is located in my home directory.
how do i make this script executable anywhere on my hard drive?
i am thinking i would have to add this script to my path, but am not sure how to do this.



lee1210
Jun 7, 2008, 01:41 PM
Open the terminal and create a file called .bash_profile in your home directory.

Place this line in this file:
export PATH=$PATH:~

Save the file.

Any new terminal you open will now have your home directory in the path. So when searching for executables with a name you've provided, that will be one directory (the last one, if you add it exactly as above) that is searched.

-Lee