On my OS X system, when I use a subshell (for example with screen), the settings in my .bash_profile are inherited, but on Ubuntu, they are not, and in order to get the same behavior I have on OS X I have to add
source ~/.bash_profile
to the start of my .bashrc.
Does Ubuntu (Linux) handle the relationship between .bash_profile and .bashrc and their use in subshells differently from OS X (BSD)? Is there an Ubuntu setting that makes it behave like OS X in this regard so that I can avoid the above line?
/etc/profileand~/.profileto see what differs there between the two systems I have? – orome May 24 '16 at 12:30~/.bash_profileare in effect when Iscreen, and those in~/.bashrcare as well (I get the effect of the former followed by the latter). But on Ubuntu, I get only the latter (~/.bash_profilesettings are not used). Perhaps there's ascreensetting on Ubuntu that does not inherit the parent shell's settings? – orome May 24 '16 at 15:13.bashrcis not sourced by.bash_profile. That leaves the questions of howscreeninherits (a) inherits all of.bash_profile(when Ubuntu does not) and (b) also reads.bashrc. – orome May 24 '16 at 16:03