I'm trying to understand a user login process on Centos 7 and I've gotten a bit confused trying to figure out when/how a Gnome terminal session defines environment variables (Gnome 3.14.4).
As near as I can tell.... a Gnome terminal will only define environment variables from the /etc/profile, ~/.profile, or ~/.bash_profile if the variables were exported in those scripts.
If they aren't exported then they don't appear in the output of either the set or printenv commands. The /etc/environment file is the exception (but it's not a shell login script).
The only thing I've found that looks like it would do this is the /etc/X11/xinit/xinitrc-common file when it sources the ~/.profile login script... But that's just a single login script and doesn't explain why exported variables in /etc/profile & ~!/.bash_profile are being displayed in set.
[ -r $HOME/.profile ] && . $HOME/.profile
If this reads the variables in the ~/.profile script... How are the variables being read for /etc/profile & ~/.bash_profile? If it matters.... I haven't selected "run command as login script"