Sunday, May 5, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 7502  / 3 Years ago, wed, september 22, 2021, 2:23:21

In order to export variables permanently, we can write the export command in the following files:



~/.profile
~/.bash_profile
/etc/profile


In my case, ~/.bash_profile does not exist, and therefore I export the variable in the other two files:



export country=UK


The problem I have now is that the variable I defined (country) is still unknown for the system. I was wondering what I should do next.


More From » command-line

 Answers
4

profile is only read when you login, have you tried a login shell bash -login,bash -,logging out and then back in or just plain old rebooting?



You can use .bashrc if want it every time you spawn a shell.


[#33638] Wednesday, September 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rontablis

Total Points: 293
Total Questions: 123
Total Answers: 104

Location: Austria
Member since Mon, Mar 1, 2021
3 Years ago
;