adding a file to my path

Discussion in 'Mac Programming' started by jamesapp, Jun 7, 2008.

  1. jamesapp macrumors 6502a

    Mar 7, 2008
    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.
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    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.


Share This Page