Jun 17, 2017 This post shows how to add an entry to the Mac OS X PATH variable - (1) for the current terminal session only, (2) permanently for the current user only and (3) permanently for all users on a Mac OS X system. Here, the Tomcat startup.sh executable is used as an example. Jul 25, 2016 As you can see, we have two method overloads to choose from. In the very first example, we used the first method overload, which only takes two input parameters: the environment variable name, and the value we want to set it to. The other method overload allows us to specify a target for the environment variable! Let’s take a quick look at.
In Mac OS X, you can set the environment variables in one of the following files :
- ~/.bashrc
- ~/.bash_profile
- ~/.profile
By default, Mac OS X does not has above files, you need to create it manually.
$PATH example
This example shows you how to set “
mongodb/bin
” folder to the existing $PATH
environment variable.Done.