To create an env variable and make it persisting, we need to edit .bash_profile file. The ~/.bash_profile file is a configuration file for configuring user environments.
Open terminal and run the following command to edit in nano. .bash_profile.
nano ~/.bash_profile
Then enter your environment variable and export as bellow
export CLIENTID="mysecretclientidvalue"
Save the file by pressing ctrl+o
and enter
.
Logout and login again to your ubuntu computer.
To check the env value has been persisted or not by entering this command:
echo $CLIENTID
This will return the value of the env persisted variable.
Top comments (0)