$ENV is for interactive shells, .profile is for login shells. Normal shells source these files according to to which of the two flags are set or not.
To make make bash behave in a compatible manner, you need to:
- Delete .bash_profile, so .profile gets sourced instead (works around bash ignoring .profile when .bash_profile exists)
- At the bottom of .profile, call $ENV (works around login bash ignoring bashrc)
- Make .bashrc call or be equal to $ENV
- At the head of $ENV, do an early exit for non-interactive shells (works around bash sourcing the bashrc when invoked non-interactively via SSH or socket, also works around the previous workaround)
In terms of startup logic, bash is the worst shell i've seen so far.
To make make bash behave in a compatible manner, you need to:
- Delete .bash_profile, so .profile gets sourced instead (works around bash ignoring .profile when .bash_profile exists)
- At the bottom of .profile, call $ENV (works around login bash ignoring bashrc)
- Make .bashrc call or be equal to $ENV
- At the head of $ENV, do an early exit for non-interactive shells (works around bash sourcing the bashrc when invoked non-interactively via SSH or socket, also works around the previous workaround)
In terms of startup logic, bash is the worst shell i've seen so far.