[ad_1]
This is without doubt one of the areas the place Linux and macOS differ so quite a lot of articles you discover solely partially apply to macOS. Primarily, on macOS, every Terminal tab runs a login shell.
- For login shells,
bashreads~/.bash_profileor (if that is lacking)~/.profile. - For interactive shells,
bashreads~/.bashrc.
So on macOS it does not really matter which of ~/.bashrc or ~/.bash_profile you select. It helps to be constant although and stick to 1 or the opposite.
To make surroundings variables obtainable in all future session, simply add them to the file of your selecting:
MYVAR='Whats up, world'; export MYVAR
PS: Personally I’ve take a look at -f ~/.bashrc && . ~/.bashrc in .profile and all definitions in ~/.bashrc. This covers each worlds (at the price of all the time loading some stuff which solely is relevant to Linux or macOS) and IMHO is nice sufficient for private use.
[ad_2]
