Profile Mia66 From Portland Maine

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. /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 ...

When you start a login shell, bash reads /etc/profile. This script typically contains code to source the scripts from /etc/profile.d. So when someone runs ssh user@serveraddress, this start an interactive login shell, which we know causes bash to read /etc/profile, hence it runs your logchk.sh script.

profile mia66 from portland maine 2

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. Why are these files not a part of /etc/profile if they are also critical to Bash startup ?

What do the scripts in /etc/profile.d do? - Unix & Linux Stack Exchange

profile mia66 from portland maine 4

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 ...

profile mia66 from portland maine 6

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.

@kuspia: 1) But my .profile IS executed as my "echo" test has proven. However, it seems it isn't sourced. 2) My fried, I know that. You don't need to copy things from my question; I know what I've written ;) 3) I don't have a .bash_profile since it has no benefit over .profile if Bash is the only shell you use, as in my case. Read the section "INVOCATION" of the Bash manual.

profile mia66 from portland maine 8