Terminal: how to add a location to $PATH

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

  1. hinkenput macrumors newbie

    Feb 14, 2012
    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. jahala macrumors regular


    Feb 7, 2008
  3. antonis macrumors 68020


    Jun 10, 2011
  4. willieva macrumors 6502

    Mar 12, 2010
    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. odinsride macrumors 65816


    Apr 11, 2007
    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