Questions tagged [environment-variables]

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.

Environment variables are a set of dynamic-named values that can affect the way running processes will behave on a computer. They can be said in some sense to create the operating environment in which a process runs. For example, an environment variable with a standard name can store the location that a particular computer system uses to store temporary files—this may vary from one computer system to another. A process which invokes the environment variable by (standard) name can be sure that it is storing temporary information in a directory that exists and is expected to have sufficient space.

https://en.wikipedia.org/wiki/Environment_variable

13704 questions
156
votes
5 answers

How to enable a virtualenv in a systemd service unit?

I want to "activate" a virtualenv in a systemd service file. I would like to avoid having a shell process between the systemd process and the python interpreter. My current solution looks like this: [Unit] Description=fooservice After=syslog.target…
guettli
  • 25,042
  • 81
  • 346
  • 663
151
votes
18 answers

OpenSSL and error in reading openssl.conf file

I am running windows xp 32bit I just downloaded Openssl from the following URL and installed it. http://www.slproweb.com/products/Win32OpenSSL.html and then I tried to create a self signed certificate by using the following command openssl req -x509…
Sreeram
  • 3,160
  • 6
  • 33
  • 44
151
votes
18 answers

Remove redundant paths from $PATH variable

I have defined the same path in the $PATH variable 6 times. I wasn't logging out to check whether it worked. How can I remove the duplicates? The $PATH variable looks like this: echo…
charles hendry
  • 1,710
  • 4
  • 13
  • 18
149
votes
10 answers

macOS Catalina 10.15(beta) - Why is ~/.bash_profile not sourced by my shell?

I want to set the environment variable I added below the line to ~/.bash_profile and ~/.profile but it didn't work. export JBOSS_HOME=/Users/{USERNAME}/Desktop/jboss7 Afterward, exit the terminal and open it again when executing echo $JBOSS_HOME I…
Reza Dehnavi
  • 2,256
  • 3
  • 16
  • 30
149
votes
5 answers

How to change value of process.env.PORT in node.js?

I'd like to change the value of process.env.PORT, how can I do this? I'm running Ubuntu 12.04.
Dennis
  • 56,821
  • 26
  • 143
  • 139
148
votes
3 answers

Re-using environment variables in docker-compose.yml

Is it possible to re-use environment variables that are shared among multiple containers? The idea is to avoid duplication, as illustrated in this example: version: '2' services: db: image: example/db ports: - "8443:8443" …
Sergei Rodionov
  • 4,079
  • 6
  • 27
  • 44
146
votes
19 answers

How Should I Set Default Python Version In Windows?

I installed Python 2.6 and Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6. When I run python in cmd, it displays the python version 2.6, which is what I want! But, when I wrote a script in a bat file and ran it, the…
rooney
  • 2,233
  • 4
  • 19
  • 10
144
votes
13 answers

Laravel 5 - env() always returns null

I try to find out why my env() helper always returns null. This causes trouble especially in app.php file, where are env() helpers widely used by default. Perhaps any mysterious server setting? My env…
Fusion
  • 5,046
  • 5
  • 42
  • 51
144
votes
8 answers

How does one change the language of the command line interface of Git?

I’d like to change the language of git (to English) in my Linux installation without changing the language for other programs and couldn’t find the settings. How to do it?
user905686
  • 4,491
  • 8
  • 39
  • 60
142
votes
9 answers

How to export and import environment variables in windows?

I found it is hard to keep my environment variables sync on different machines. I just want to export the settings from one computer and import to other ones. I think it should be possible, but don't know how to do it. Can anyone help me? Thanks.
max_y
  • 1,423
  • 2
  • 10
  • 4
138
votes
7 answers

What is the exact meaning of IFS=$'\n'?

If the following example, which sets the IFS environment variable to a line feed character... IFS=$'\n' What does the dollar sign mean exactly? What does it do in this specific case? Where can I read more on this specific usage (Google doesn't…
Yanick Girouard
  • 1,383
  • 2
  • 9
  • 4
138
votes
8 answers

Make $JAVA_HOME easily changable in Ubuntu

In Ubuntu, I'd like to switch my JAVA_HOME environment variable back and forth between Java 5 and 6. I open a terminal and type in the following to set the JAVA_HOME environment variable: export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun And in that…
Junho Park
  • 1,491
  • 2
  • 10
  • 11
138
votes
10 answers

Environment variable to control java.io.tmpdir?

I've used the TMP environment variable to control things like where gcc writes it's temporary files, but I can't seem to find an equivalent for java's createTempFile API. Does such an environment variable exist?
Zach Hirsch
  • 24,631
  • 8
  • 32
  • 29
135
votes
12 answers

Parse config files, environment, and command-line arguments, to get a single collection of options

Python's standard library has modules for configuration file parsing (configparser), environment variable reading (os.environ), and command-line argument parsing (argparse). I want to write a program that does all those, and also: Has a cascade of…
134
votes
11 answers

Is there any way to set environment variables in Visual Studio Code?

How can I set up environment variables in Visual Studio Code?
Shakti Kumar Das
  • 1,365
  • 2
  • 9
  • 4