Setting Environment Variables in Unix Shell

Setting environment variables allows you to reference sensitive data, like passwords and API keys in an application, without making them publicly visible online or in a public repository.



To do this, first check to make sure you are using a bash shell:

Then edit your “~/.bashrc” file and add:

Save the file and you’re all set. You will have to open a new shell or restart your terminal to continue.