Terminal: how to add a location to $PATH

Discussion in 'Mac Programming' started by hinkenput, Feb 14, 2012.

  1. macrumors newbie

    Joined:
    Feb 14, 2012
    #1
    I need a simple line of code to tell Terminal to look for my scripts in Applications/Scripts, where I put them. In other words, when I enter "echo $PATH" I want to add ":/Applications/Scripts" to the string that is returned. I am not a programmer, and my son wrote this command for me a couple of years ago, and it worked, but I didn't save it. I've tried searching the web, but haven't been able to find it. Can anyone write it for me? Thanks.
     
  2. macrumors regular

    Joined:
    Feb 7, 2008
    #2
  3. macrumors 65816

    antonis

    Joined:
    Jun 10, 2011
  4. macrumors 6502

    Joined:
    Mar 12, 2010
    #4
    Put
    export PATH=$PATH:/Applications/Scripts
    in ~/.bash_profile

    This is assuming you're using bash as your shell, which you probably are. If you're using csh or tcsh, you need to put
    setenv $PATH:/Applications/Scripts
    in ~/.cshrc
     
  5. macrumors 65816

    odinsride

    Joined:
    Apr 11, 2007
    #5
    Also don't forget to reload your .bash_profile by typing ". ~/.bash_profile" (otherwise changes won't take effect until next login)
     

Share This Page