1

I have a requirement where I need to set a custom environment variable called CLUSTER_ENV = '@fooURL' The steps I have followed are:

  1. Open terminal, open bash_profile and save CLUSTER_ENV='@foo'. When I do echo $CLUSTER_ENV , I get blank output.
  2. I did the same thing in the 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

SeaWarrior404
  • 3,811
  • 14
  • 43
  • 65

1 Answers1

1

As you will normally do on any Linux distro: export CLUSTER_ENV=my.url.com which will have to be added to ~/.bash_profile

Sergiu
  • 2,928
  • 3
  • 27
  • 37