Where are the environment variables displayed by "env"?

Questions about software.
albert.wagner
Posts: 53
Joined: 10 Mar 2018 16:43

Where are the environment variables displayed by "env"?

Postby albert.wagner » 15 Sep 2018 02:48

Where are the environment variables stored in Solydx? There is nothing in /etc/environment, where I expected to find them.

User avatar
ilu
Posts: 2059
Joined: 09 Oct 2013 12:45

Re: Where are the environment variables displayed by "env"?

Postby ilu » 15 Sep 2018 22:02

There are a LOT of environment variables displayed by "env". Nobody has the time to write a digest on it. You'll have to research that yourself if you are interested. https://wiki.debian.org/EnvironmentVariables (systemd and PAM are involved) and https://standards.freedesktop.org/ are good starting points to learn about unix standards.

If you want to set environment variables, you can do that in either ~/.profile or ~/.bashrc. For all users you could also use /etc/profile.d.

albert.wagner
Posts: 53
Joined: 10 Mar 2018 16:43

Re: Where are the environment variables displayed by "env"?

Postby albert.wagner » 24 Sep 2018 02:52

Thanks, Ilu.
I knew that they were all, like PATH, put in from by various sources. I just assumed that there was a single place that the various sources put their contribution. It just didn't make sense that the env command had to run around to dozens of places to aggregate its output, and to do this over and over every time the command was run. e.g. many distros place the complete PATH into /etc/environment.

User avatar
ilu
Posts: 2059
Joined: 09 Oct 2013 12:45

Re: Where are the environment variables displayed by "env"?

Postby ilu » 24 Sep 2018 14:21

albert.wagner wrote:
24 Sep 2018 02:52
e.g. many distros place the complete PATH into /etc/environment.
I think that changed with the introduction of systemd but I'm not sure.


Return to “Software”

Who is online

Users browsing this forum: No registered users and 2 guests