Skip to content

Latest commit

 

History

History
24 lines (13 loc) · 1.19 KB

File metadata and controls

24 lines (13 loc) · 1.19 KB

bash profile

Bash profiles are for login shells, ie: the first login via console or ssh.

Running bash in an existing shell, or starting a new bash terminal in Xbuntu, does not start a login shell.

Login shells might include additional things, like a message of the day or diagnostic info.

profile files are /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile. They are only executed by login shells

.bashrc is executed for interactive non-login shells. Its usually a subset of what you want to do at login, and is sourced from a bash_profile.

bash login shell

bash -l will start a login shell.

For both a login and non-login shell, env vars from the parent will be inherited.

However because a login shell executes /etc/profile, on Mac OS this calls path_helper which moves the system paths (eg: /usr/*, /System/* etc) to the front of PATH. This will affect shims like pyenv, fnm etc. that override system paths.

References