LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Intro (https://www.linuxquestions.org/questions/linuxquestions-org-member-intro-24/)
-   -   How Are Environment Variables Defined In A Gnome Terminal Session? (https://www.linuxquestions.org/questions/linuxquestions-org-member-intro-24/how-are-environment-variables-defined-in-a-gnome-terminal-session-4175621534/)

kurama 01-13-2018 03:49 AM

How Are Environment Variables Defined In A Gnome Terminal Session?
 
Hello... and thanks in advance for any help anyone can offer me with my question! I'm hoping someone will have a little patience with me and walk me through this!

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

jsbjsb001 01-13-2018 04:13 AM

This post looks very, very similar to this: https://www.linuxquestions.org/quest...on-4175620054/

Post reported.

Mara 01-13-2018 09:47 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 02:37 AM.