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.

410 questions
2
votes
2 answers

Caching of path environment variable on windows?

I'm assisting one of our testers in troubleshooting a configuration problem on a Windows XP SP3 system. Our application uses an environment variable, called APP_HOME, to refer to the directory where our application is installed. When the application…
jwir3
  • 155
  • 1
  • 2
  • 10
2
votes
2 answers

Modify default PATH environment variable in Solaris 10

I know I could modify /etc/profile.. but is there a better way? I know /etc/profile will affect terminals but I want all processes to be affected. crontab, service manager, startup scripts, etc.. Edit: I have an answer to edit the PATH for cron..…
700 Software
  • 2,233
  • 10
  • 49
  • 77
2
votes
1 answer

Bash build environment settings

I'm newbie in Bash and I'm using MinGW as a GCC compiler. I have .profile in my home directory which sets building environment. Here is .profile content. What's a difference in commented/uncommented lines? Why GCC doesn't work with uncommented…
Toktik
  • 147
  • 9
2
votes
1 answer

How can I get the complete Windows Environment Variables when doing non-interactive SSH login?

We had been using OpenSSH 3.8.1 P1 until moving to new Windows 64-bit environments. That version of OpenSSH returned the full Windows environment to the non-interactive SSH login, allowing us full access to the environment variables. In newer…
user59733
2
votes
2 answers

How to edit users PATH environment variable remotely in Windows?

Wondering what tools are available to remotely edit (find and replace actually) the PATH environment variable on all users workstations across the enterprise? We do use SCCM (formerly SMS), but I don't know if that provides the capability to do…
Jay
  • 123
  • 1
  • 1
  • 4
2
votes
1 answer

Environment variables in Weblogic Managed Server with SSL nodemanager

We have a C legacy application start with JNI that requires environment variables. Not java -Djava.library.path -Dvar=foo as these are purely java. I need real environment variables. When we setup our domains, we usually use the SSH method to start…
Eric Darchis
  • 153
  • 1
  • 7
2
votes
4 answers

FreeBSD tcsh and terminal window size

When I'm working on my FreeBSD server's ssh, it always assume that terminal width is 80 columns. E.g. man pages show up in one thin column and all programs that use COLUMNS and LINES environment variables to guess terminal size work only in 80…
2
votes
2 answers

'pargs' command in FreeBSD or Linux

What's the FreeBSD (or Linux) equivalent to the 'pargs' command, available in Solaris? Many times I want to know what are the environment variables for a given process space, with no help from these systems.
anderson
  • 301
  • 4
  • 7
2
votes
3 answers

Slackware scripts started at boot time need env vars from /etc/profile.d/* to be set

Hey, I have this problem, that scripts started at boot time from rc.local don't have environment variables (defined at /etc/profile.d/*) set at the time of their startup. What should I do ? "su - lisak -c…
lisak
  • 667
  • 2
  • 7
  • 19
2
votes
1 answer

sourcing environment variable in bashrc: directly vs export from file yields different result - why

I am running systemd via user (i.e. enable-linger $USER) and I interact with services via systemctl --user I noticed a strange issue. Sourcing Type 1 In order for the above systemd to work for a user, I need to add export…
Newskooler
  • 211
  • 1
  • 3
  • 14
2
votes
1 answer

How does Windows set the %SystemRoot% variable?

The %SystemRoot% environment variable contains the path to the Windows directory. (e.g. c:\windows) SystemRoot is not configured in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, it is automagically…
Martin
  • 589
  • 4
  • 10
  • 27
2
votes
0 answers

How to create .env multiline variable

The title may be a bit confusing, so a little explanation. I need to configure an application by passing a PKCS1 PEM encoded key using environment variable. The App is configured using a .env file Locally I just export MY_ENV_VAR=$(cat my_key.pem),…
Krystian
  • 306
  • 1
  • 6
  • 19
2
votes
1 answer

/etc/environment.d does not take effect on Archlinux

I believe systemd-environment-d-generator parses conf files under /etc/environment.d/. cat /etc/environment.d/60-foo.conf FOO=xxx But even after reboot, the environment variable 'FOO' does not appear in user processes. How to let my systemd take…
takaomag
  • 261
  • 1
  • 3
  • 7
2
votes
3 answers

Using ENV variables in Postfix and Dovecot configuration files

I'm trying to dockerize my mailing server and I'm having some troubles regarding how am I supposed to use environment variables inside Postfix and Dovecot configuration files (I'm using the latest packages available through apt for ubuntu:18.04). I…
2
votes
0 answers

How to auto init direnv on Google Cloud Shell?

my .bashrc has these lines at the bottom: if [ -f $HOME/tools/bashrc ]; then source $HOME/tools/bashrc fi and $HOME/tools/bashrc has this code at the bottom: eval "$(pyenv init -)" pyenv virtualenvwrapper_lazy eval "$(direnv hook…