Linux environmental variables

If you spend any time at all in Linux environments, sooner or later you will need to use environmental variables

To set a environmental variable:

export MY_VARIABLE_NAME = "VARIABLE"

and confirm it works by testing it:

echo $MY_VARIABLE_NAME

You can save your exports in either /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile they are loaded in that order. Just add your export line here. For non login shells, you can add it to ~/.bashrc

export MY_VARIABLE_NAME = "VARIABLE"

Leave a Reply

Your email address will not be published. Required fields are marked *