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
0 answers

Need to Pass Environment Variables Through Apache Proxy

BACKEND: I have Tomcat connected to Apache and JKMount'ed to webapps.demo.example.com. FRONTEND: The primary VirtualHost is setup for demo.example.com. I have one application Proxy'd to BACKEND. This works great except the ServerName and…
1
vote
1 answer

Within FreeBSD jail – setting global environment vars

I need to set a systemwide environment variable (i.e. NODE_ENV=production) in a FreeBSD jail. I did try setting it in /etc/profile, but when I sourced it root@www:/ # source /etc/profile I got export: Command not found. It works on the host…
LongHike
  • 157
  • 1
  • 6
1
vote
0 answers

Permanently load environment variable on aws ssm login in windows PowerShell

I am using ssm login for logging into my windows server 2016 data center edition. When I make a RDP connection and run PowerShell from RDP, All the system environment variables are loded correctly however the same fails to load when using a aws ssm…
1
vote
1 answer

Can multiple nginx statements be on the same line in a config file?

The Problem I'm creating a docker image which dynamically creates nginx config based on environment variables. I would like to minimise the number of environment variables required. I have a config template file that looks something like…
1
vote
1 answer

How can I make an environment variable visible to a script placed in /etc/cron.daily?

Say I have a script named "mydailyscript" containing the following: #!/bin/bash if [ ! -z $MYDAILYLOG]; then exec 1>$MYDAILYLOG fi echo This script ran on $(date) and I then copy this script to /etc/cron.daily. Where do I define the environment…
1
vote
1 answer

Task under SYSTEM won't run Win Srv 2k8R2

My company has a software that updates our installers on clients' servers. During the setup, a environment variable is created along with a task with the following lines: Variable: setx ccloud "C:\Capela\CCloud" /M Obs.: the path used is the…
1
vote
2 answers

Why is %ProgramFiles(x86)% returned without quotes?

Using this simple test batch script: @echo off echo %ProgramFiles% echo %ProgramFiles(x86)% is my output: "C:\Program Files" C:\Program Files (x86) One variable is enclosed in quotes while the other isn't? Is this a bug of some sort, or a simple…
Matt Hanson
  • 1,682
  • 1
  • 23
  • 34
1
vote
1 answer

APACHE SetEnv directive (from .htaccess) not send to CGI process

I don't understand Apache2 mecanism in this scenario : 1/ In this location : var/www/cgi-bin/ (user's group rights : www-data) i've a CGI script (php-cgi) who will execute PHP app + VAR environement version : #!/bin/bash # file :…
gmini
  • 21
  • 1
  • 5
1
vote
1 answer

Docker conatiner: Get passed environment varaible in tomcat spring mvc application

I am trying to deploy a SpringMVC application within a Docker container on top to tomcat8. My problem is This SpringMVC application receive parameters using following code String username = System.getProperty("db.username"); String password =…
PHP Avenger
  • 259
  • 2
  • 8
1
vote
1 answer

How to Easily Pass an Environment Variable to an .exe in "Bash on Windows 10"?

I am looking for a way to easily pass an environment variable to a .exe when invoked from the Bash on Windows 10 terminal. It seems that TEST=somevalue example.exe does not work.
1
vote
1 answer

How to set LESSCHARSET system wide?

This is a follow up on How to make the 'less' command handle UTF-8? If I want to set options for less globally, so that each user doesn't have to fiddle with their own env vars (.basrc, etc) individually, where should it be set? /etc/bashrc is not a…
gcb
  • 344
  • 1
  • 4
  • 18
1
vote
2 answers

Docker Compose can't get environment variables and relation information

I'm trying to build an Apache-PHP + MySQL + PHPMyAdmin entities environment without success. I reduce my project as simple as possible with thoses files : test-docker $ ls -la total 24 drwxrwxr-x 2 david david 4096 janv. 18 11:01 . drwxrwxr-x 20…
David
  • 113
  • 3
1
vote
3 answers

Error: Impossible to define SCIHOME environment variable

I am trying to use Scilab through PHP on my server like described in this document. I am running Ubuntu 16.04. I have an Apache server running. I installed Scilab with apt-get install scilab. I can successfully write scilab code like: scilab -nwni…
Sharcoux
  • 179
  • 2
  • 10
1
vote
1 answer

Using environment variables to provide shortcuts across multiple OS Versions and architectures

This week I was facing a scenario, where regular techniques to deploy shortcuts through GPOs are not sufficent anymore. I was facing an environment, where XP,7,10 is present in both, 32 bit (x86) and 64 bit (x64) architectures - and multiple…
dognose
  • 164
  • 10
1
vote
0 answers

How to set http_proxy env variable and have wget using it transparently before login (Debian)

By setting environment variable http_proxy="http://proxy-server" I'm able to call programs like wget, curl, etc, using the set http proxy transparently. To persist this to the whole system I've added http_proxy to the /etc/environment. I'm using…
filipe
  • 111
  • 4