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

How to set a tmp env variable from inside a bash script

I have a simple bash script: #!/bin/bash export MONGOMS_DOWNLOAD_URL="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz" export MONGOMS_VERSION="4.2.8" but when i run this './preinstall.sh' and then echo $MONGOMS_VERSION…
John
  • 887
  • 4
  • 15
  • 25
0
votes
1 answer

How do I set enviromental varialbes for my ubuntu server?

I have a ubuntu server deployed at digitalocean with gunicorn and nginx to host my django project. Now I want to save my secret key in an env. var. . I searched in the internet and I found that I have to modify a file called .bash_profile but I…
Sven
  • 135
  • 1
  • 6
0
votes
1 answer

How to interpolate Jenkins environment variables inside Dockerfile?

I have a Jenkins pipeline, One of the stages of the pipeline is to build the artifact from a java application code. The artifact always get the name hello-world-${BUILD_ID}.war using BUILD_ID jenkins environment variable for every build the name of…
Sara Ben Shabbat
  • 59
  • 1
  • 3
  • 7
0
votes
2 answers

Where to Unset or change $_SERVER['LD_LIBRARY_PATH']?

I have an Apache 2.4 proxying to PHP7.4.4 php-fpm and I am trying to hide or unset the $_SERVER['LD_LIBRARY_PATH'] variable. How do I change or get rid of this variable $_SERVER['LD_LIBRARY_PATH'] in the PHP output? Assume that apache2.4 is…
user2176499
  • 111
  • 3
0
votes
1 answer

Are /etc/profile.d scripts always executed on server boot?

I have a GCP instance with Ubuntu 18.04, and I'm using GCP secret manager to pull down secrets at boot time with a script in /etc/profile.d, that way I can setup system-wide environment variables that are then used by my other services. As I…
0
votes
1 answer

Where is $TERM set in Linux

Specifically Ubuntu 16.04 but is there a general way it is set? The reason I ask is that I have several Ubuntu 16.04 installations (VMs on kvm/libvirt/qemu) where nothing specific was done to set this variable at installation and yet they have…
0
votes
1 answer

Windows user environment variables not available in OpenSSH session

I am running OpenSSH server on my Windows XP machine. When I log in from a remote machine using PuTTY or any other ssh client, I am unable to see any of my user-level environment variables from the shell session. I see only the global ones. Do I…
Phani K
  • 115
  • 2
  • 4
0
votes
1 answer

Grafana - Config overridden from Environment variable

I'm trying to follow Configure with environment variables / root_url # grep GF_ROOT_URL docker-compose.override.yml - GF_ROOT_URL=https://g.x.com/ # yet, when I invite users into Grafana, they're getting invited to…
alexus
  • 13,112
  • 32
  • 117
  • 174
0
votes
1 answer

Environment variables within docker images

My goal is to use environment variables in the docker-compose.yml file that can be referenced inside the application itself like in config/database.yml docker-compose.yml ... environment: $DB_NAME: myapplication $DB_USER: appadmin $DB_PASS:…
Bert
  • 1,028
  • 1
  • 16
  • 33
-1
votes
1 answer

How to increase the Java Memory in Windows Server 2012 R2?

I am trying to follow This Link to increase the memory that is available to the Java Runtime Environment, because I encountered the "insufficient memory for the Java Runtime Environment to continue" when running Tableau Server. But my question is: I…
-1
votes
1 answer

Can't change global PATH environment in ubuntu 18.04

I tried editing /etc/environment, changed it by removing games and adding my swift installation location, so now it looks like: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/swift/usr/bin" That didn't work (even tried…
iMoses
  • 111
  • 4
-1
votes
1 answer

Calling a utility by name, without the full path, from cron doesn't work

I have some console utility installed. It's in /usr/local/bin/my_utility. I can call it as my_utility and it works well. I've created a cron task which runs a bash script. That bash script calls my_utility. The error which occurs only when I can the…
Joddy
  • 69
  • 2
  • 5
-1
votes
2 answers

How to reload environment variables from within a script

I would like to be able to regenerate the value held by the environment variables inside my testing environment, and have the new values be read by PHP-FPM. I have written a script that regenerates the environment variables, writes them to a file,…
Danack
  • 1,216
  • 1
  • 16
  • 27
-1
votes
4 answers

exporting variable globally

I can save the IP address of the current server to a variable and echo it out. # myvar=$(/sbin/ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}') # echo $myvar 10.11.6.117 What I want to do is to "export" it as a…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
-1
votes
3 answers

Set alias or environmental variable in Unix

I have a VPS and an associated IP address for it. I'm doing a lot of work with it in my bash shell and I'm wondering if there's some way I can create either an alias or a environmental shortcut for the IP address to avoid having to type it every…
Casey Flynn
  • 217
  • 4
  • 13
1 2 3
27
28