I am using mac os mojave (10.14.3). I set the environment variable in both
~/.bash_profile
and ~/.bashrc
and I ran both ~/.bash_profile
and ~/.bashrc
. Then in the same terminal I can see the values which I set (using printenv
), but if I open a new terminal then I can not see previously set env variable.
Please give some suggestions.
Update
In mac os Bigsur(11.2.3), the default terminal was zsh ( I did not check for other versions) and setting envs in ~/.zshenv
as in
echo 'export PATH=$PATH:$PATH:~/Library/Android/sdk/build-tools/29.0/' >> ~/.zshenv
and running . ~/.zshenv
helped me saving the envs permanently