Santa Barbara Independent: Santa Barbara Unified Test Scores Rise to Pre-Pandemic Levels Detroit News: Here are Michigan's top-scoring high schools on the SAT as overall scores rise Here are Michigan's top-scoring high schools on the SAT as overall scores rise 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 link to /bin/bash) or is started with the --posix flag, it tries to emulate sh, and only reads .profile. Footnotes: Actually, the first one of .bash_profile, .bash_login, .profile See also: Bash ... A login shell first reads /etc/profile and then ~/.bash_profile. A non-login shell reads from /etc/bash.bashrc and then ~/.bashrc.

Key Insights

Why is that important? Because of this line in man ssh: If command is specified, it is executed on the remote host instead of a login shell. In other words, if the ssh command only has options (not a command), like: ssh user@host It will start a login shell, a ... 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, which are also executed at startup time by the shell.

Final Thoughts

What do the scripts in /etc/profile.d do? - Unix & Linux Stack Exchange The one possible exception is /etc/profile and .profile, which may be used by multiple different shells (including at least sh and bash). There is something called an environment associated with every running process which can contain variables that may affect the behavior of said process. 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 startup file. That is, provided that only sh commands are put in .profile For example, alias is a valid built-in command of bash but unknown to sh.

Therefore, if you had only a .profile in your home directory and ... What is the difference between .profile and .bash_profile and why don't ... I erroneously assumed that the service would have access to the environment variables all users inherit from scripts/exports under /etc/profile.d Is there a way to accomplish this without having to manually copy the variables in systemd unit file definition. @kuspia: 1) But my .profile IS executed as my "echo" test has proven.