Questions tagged [environment-variables]

Environment variables are configuration options that can be set in a shell or other similar environments. All programs started from within the shell can read them and configure themselves.

Environment variables are key-value-pair configuration options like KEY=valueor FOO=bar. Environment variables allow you to configure a program before it gets executed and without the need to store these variables in proprietary configuration files.

They are present on all POSIX systems (Unix, Linux, BSD, Mac OS, DOS, Windows, ...). Environment variables can be set by any shell and read by nearly any programming language.

Some programming languages allow you to set Environment variables, but they only persist within the current process. You can't set them to be visible by the calling shell. So they are not useful for inter-process communication.

414 questions
2
votes
1 answer

Where to export a truly global environment variable?

I want to set an environment variable that will be visible to all processes launched by Upstart. This is on a CentOS system, but I presume the same applies to Ubuntu given that they both use Upstart. Somewhere in /etc/init/ perhaps? Note that…
Socio
  • 150
0
votes
2 answers

Windows restart after Env. Var. change?

When do I need to do a restart for my server to use a variables new value, or no restart necessary? Is it OS version dependent?
user8160
  • 329
-2
votes
3 answers

See someone unused environment variable

Let's say I log in as Bob to host server. Then i do : export MYSEC='secret' Let's say Alice has access to the same host and also sudo permissions. How can Alice see the value of MYSEC? Note : let's say Bob never closes the session so the value…
-3
votes
2 answers

How to set environment variables

Say, I would like to change my editor system-wide to nano. I was doing this with echo 'export EDITOR=/usr/bin/nano' >> /etc/bashrc As I learned, it was a bad idea, because if you accidentally omit one >, you will overwrite bashrc and won't be able…