How to create variable.

| Aug 17, 2024 min read

To create variable.


export DB_USERNAME=dbuser       

export DB_PASSWORD=secretpwdvalue

export DB_NAME=mydb

printenv | grep DB

echo $DB_NAME  "IF YOU WANT TO SEE"

export DB_NAME=NEW-DB-NAME    "To change new name"

if you want to do it permanently you have to use "Vim"

vim .bashrc

"at the bottem" 

export DB_USERNAME=dbuser       

export DB_PASSWORD=secretpwdvalue

export DB_NAME=mydb

esc
:qw

source .bashrc

printenv | grep DB

"if you want to do it for all users" 

vim /etc/environment

Path