lampShade
lampShade

Reputation: 4391

How do I set $PATH

I'm trying to install uncrustify https://github.com/tonyarnold/Xcode-4-Uncrustify-Automator-Services

However, I don't know what $PATH is or how to set it. Could someone help me out. I did install homebrew but I'm a little lost as to how to proceed

Upvotes: 1

Views: 1193

Answers (2)

Learner
Learner

Reputation: 672

PATH is an environment variable on various operation system, specifying a set of directories where executable programs are located. (See more on http://en.wikipedia.org/wiki/PATH_(variable) )

On MAC OS X, you can easily check the PATH settings by following steps:

  1. Start Terminal app
  2. Enter following command
    $echo $PATH
  3. you will see directories separated by colon (":")

Now, do you know where did you install homebrew? If yes, check that directory is listed in your PATH environment variable. Another easy way to check if your executable is in PATH or not by following steps...

  1. Start Terminal app
  2. Enter following command
    $which uncrustify
  3. If above command shows you full path of uncrustify, then its already in your path. if not then you need to add it in PATH.

How to add PATH
There are several ways to do so in MAC OS X.

  1. by editing ~/.profile file and adding following line:
    export PATH=/path/to/dir/where/you/install/homebrew:$PATH
  2. by editing /etc/paths and add a line for the directory where you installed Homebrew
  3. by creating a file( i.e. homebrew) under /etc/paths.d/ and add a line for directory where you installed Homebrew)

Upvotes: 3

Related Questions