Feb 27, 2019 · The original sh sourced .profile on startup. bash will try to source .bash_profile first, but if that doesn't exist, it will source .profile. Note that if bash is started as sh (e.g.

Understanding the Context

/bin/sh is a. The .profile dates back to the original Bourne shell known as sh. Since the GNU shell bash is (depending on its options) a superset of the Bourne shell, both shells can use the same. The one possible exception is /etc/profile and .profile, which may be used by multiple different shells (including at least sh and bash).

Key Insights

There is something called an environment associated. It says that the /etc/profile file sets the environment variables at startup of the Bash shell. The /etc/profile.d directory contains other scripts that contain application-specific startup files,. You can add it to the file .profile or your login shell profile file (located in your home directory). To change the environmental variable "permanently" you'll need to consider at least these situations: Jul 25, 2024 · If I run source ~/.profile it does get added to my PATH.

Final Thoughts

I definitely don't have a ~/.bash_login or ~/.bash_profile -- so why would bash not read my local .profile? adding in.