LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Missing environmental variables in CentOS7? (https://www.linuxquestions.org/questions/linux-newbie-8/missing-environmental-variables-in-centos7-4175603612/)

fanoflq 04-11-2017 12:14 AM

Missing environmental variables in CentOS7?
 
Code:


[root@centos7-1024ram-minimal ~]# cat /etc/environment
#Returns nothing.

~/.bash_profile is the place for
user specific environment and startup programs.
E.g. Adding a new path to PATH variable.
So PATH was defined before .bash_profile is executed.

Since /etc/environment is empty,
but command env produces a lot of
environmental variables.
Where were those env variables defined?

Thank you.

ondoho 04-11-2017 01:40 AM

all over the place, is my guess.
and as you can see from the output.
certain shells have the ability to define persistent environment variables, i think they're called login shells.
everything that a login shell parses. (i hope i'm right with this, it's sort of "felt" knowledge)
good starting point: /etc/bash.bashrc /etc/profile, and the same for your $HOME


All times are GMT -5. The time now is 08:08 PM.