Reputation: 4167
I have a requirement where I need to set a custom environment variable called CLUSTER_ENV = '@fooURL'
The steps I have followed are:
bash_profile
and save CLUSTER_ENV='@foo'
. When I do echo $CLUSTER_ENV
, I get blank output.bashrc
file and in this case, the $CLUSTER_ENV
shows the value only when I run it in the same terminal window.Which is the best or recommended way to permanently set the environment variable on a Mac? Im running El Capitan.
I have gone through these links for reference:
http://osxdaily.com/2015/07/28/set-enviornment-variables-mac-os-x/
Mac OS X 10.9 - setting permanent environment variables
Upvotes: 1
Views: 1528
Reputation: 3185
As you will normally do on any Linux distro: export CLUSTER_ENV=my.url.com which will have to be added to ~/.bash_profile
Upvotes: 1