Say I created a linux user account called john. John wants to create a variable called MYVAL with the value Hello World in the linux shell (bash)
MYVAL = ‘Hello World’
John does not want to redeclare this variable every time he logs in. Is there some linux config file or start up file that john can declare this variable in such that it will populate every time he starts up his computer?
This question is better off on serverfault.com, however the answer is yes. You can edit your
.bashrcor.bash_profilefiles in your home directory to set up environment variables at login time..bash_profileis the best place for an environment variable like you describe..bash_profilewill be run each time you log in, whereas.bashrcis run each time you open a shell. Slight, but important difference.