Environment variables are dynamic values that can affect the behavior of processes and programs running on a computer's operating system.
These variables store information such as system configuration settings, user preferences, or data that is used by various software applications.
Environment variables are used to control how programs behave and to provide them with necessary information.
Open the terminal
CTRL + SHIFT + T
Check your shell
My output is
Your output might be one of the following:
Edit the shell configuration
Use your favorite text editor to edit the shell configuration file. I'm going to use
nano. You can use nano, vi, vim, gedit and even VS Code.
Add the variables
~/.bashrc, add the variables at the end:
export GITHUB_TOKEN="glpat-Z2hxZY6BhDPyZwQbYuZm" export DOCKER_TOKEN="dckr_pat_ORhj8i17IaMZ8gvLMqZgdKnkD9Z" export PG_USER="my_user" export PG_PASS="d9l85nbp"
Save the changes and exit
if you are using nano, follow the order:
CTRL + X;
Y and press Enter;
Confirm the changes
Check the changes
echo $GITLAB_TOKEN echo $DOCKER_TOKEN echo $PG_USER echo $PG_PASS
You've made it!
Let's become friends
I hope this article has been helpful to you. Please feel free to reach out if you have any questions. Your thoughts, suggestions, and corrections are more than welcome.
By the way, don't hesitate to drop your suggestions for new blog articles.
I look forward to seeing you next time.