Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jamesapp

macrumors 6502a
Original poster
Mar 7, 2008
544
0
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

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Open the terminal and create a file called .bash_profile in your home directory.

Place this line in this file:
Code:
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.