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
1
vote
1 answer

Use custom environment properties from Elastic Beanstalk for htaccess

Is there a way to use the custom environment property of elastic beanstalk in htaccess? I only want to rewrite http to https when not running locally so I thought I could do this by using the environment property of elastic beanstalk as a…
1
vote
5 answers

How can I ensure that an environment variable is set for a user in a bash session?

How can ensure that a environment variable is set for a user? I have MYVAR=whatever export MYVAR in the ~/.bash_profile but a report from the user suggests that it hasn't worked for them. What could have happened?
jjujuma
1
vote
2 answers

OpsWorks environment variables available to PHP CLI

We are deploying a Laravel-based application to AWS using OpsWorks. We have defined environment variables through the OpsWorks console and they are correctly seen by Apache. However, when running CLI tasks such as artisan commands, they are not…
1
vote
2 answers

Environment variable

I'm using setx to set a Environment variable. My command is setx -m PSR_NLC_FILE "%PROGRAMFILES(x86)%\Test Folder\" But when i check on my system is set to C:\Program Files (x86)\Test Folder" The path is not found because of the quote. When i use…
Sinista
  • 87
  • 1
  • 2
  • 10
1
vote
0 answers

Load OpenMPI module for Apache httpd

How can I tell Apache httpd which version of MPI to use? I'm trying to run a Django web application under Apache httpd, and some of our pages make MPI calls with mpi4py. The problem is that I get an ImportError when a page tries to import…
Don Kirkby
  • 1,354
  • 3
  • 11
  • 23
1
vote
2 answers

How do I modify the system PATH in Windows 2003/Windows 2008 using a script?

How do I modify the system PATH environment variable using script (or even a registry setting) so that when Windows boots it's already configured?
Kev
  • 7,877
  • 18
  • 81
  • 108
1
vote
1 answer

mailx command strange behaviour from cron

I have a script that redirect the df output to a file and then send it in an email. The mail command is set up as following: /usr/bin/mail -s "Subject" -r from@nowhere.com toaddress@somewhere.com < /tmp/diskSpace.txt Everything is working correctly…
0wn3r
  • 866
  • 1
  • 8
  • 21
1
vote
1 answer

Setting enviromental variables for login shells under root account in FreeBSD

I am currently in the process of configuring Open Grid Scheduler in FreeBSD. As part of this process I need to set the environmental variableSGE_ROOTas root. To do this I have been experimenting with attempting to set this value through the root…
user225584
1
vote
2 answers

Change apache (PHP) $PATH environment variable on CentOS with cPanel

I need to add a path to $PATH environment variable for PHP scripts on CentOS linux server with cPanel Pro 1.0 and Apache 2.2.27. For Ubuntu or SuSE it just means adding the row export PATH=$PATH:/path to /etc/sysconfig/apache2, but this file is…
Michal Gow
  • 197
  • 1
  • 9
1
vote
1 answer

What core environment variables should be set for a Windows service?

When using a service manager like srvany or nssm to run a normal program as a service, you can set the program's environment using the registry as documented here: http://support.microsoft.com/kb/197178. When doing this, you need to set all the…
MicahStetson
  • 133
  • 6
1
vote
1 answer

order of operations for environment variables

I want to understand how environment variables are set and reset (overridden). I'm running Apache/2.2.24 (Unix) PHP/5.4.14 on a mac . My theory is this: Environment vars can be set in bash, then they can be overwritten with httpd.conf preceding a…
alyda
  • 111
  • 4
1
vote
1 answer

Trying to create a GPO shortcut to local app data directory

We have a lockdown browser application that was installed on all of our students' laptops, but it was installed to the local app data of the user that performed the install. Therefore, none of our students see the application, because they are all…
1
vote
1 answer

env variable: username returns hostname within a Scheduled Task - GPO

I am editing a Group Policy Scheduled Task. In General, Security Options "When running the task, use the following user account:" I have the following- %USERDOMAIN%\%USERNAME% Updating the gpo, and checking the result on a workstation, I see that…
1
vote
2 answers

ssh SendEnv from windows to linux server using cygwin

I am doing ssh to a Open SUSE linux server from windows cygwin. I am trying to send one of my local environment variable through the ssh command so that I can load some specific .bashrc file right after logging in. Here is what I have tried…
Samiron
  • 123
  • 7
1
vote
1 answer

Using mod_expires conditionally depending on an environment variable

I've borrowed some mod_expires code from the HTML5 Boilerplate that adds some sensible defaults for asset expiry (I have filename version revving configured with htaccess so I can add mtimes before asset extensions like…
Bailey Parker
  • 141
  • 1
  • 7