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

Unable to export service account key in Terraform #GCP

I have downloaded the GCP service account key to my local system. In Terraform, I have set the GOOGLE_APPLICATION_CREDENTIALS as a path to this file in the startup-script part of my bastion instance. Below is a snippet: variable…
0
votes
1 answer

How to set the "ASPNETCORE_ENVIRONMENT" environmentVariable in the WEBROOT (web.config) with APPCMD.exe?

How am I able to set the sites web.config "ASPNETCORE_ENVIRONMENT" environmentVariable with APPCMD.exe? So far I've tried ending it using /commit:MACHINE/WEBROOT, /commit:webroot and I get the below: appcmd.exe set config "Default Web Site/Help"…
0
votes
1 answer

Pass variable in remote SSH-command in Jenkins-job

i have a little test job: touch 22.txt echo "wwe" > 22.txt test=$(echo ${BUILD_NUMBER}) echo $test ssh jenkins@srv1 "mkdir D:\myfolder\$test" ssh jenkins@srv1 "dir D:\myfolder\" BUILD_NUMBER means build number of job in Jenkins What i have in…
Piduna
  • 541
  • 4
  • 12
  • 25
0
votes
0 answers

What is the best approach to storing and deploying environment variable files to Node.js if they are excluded from version control?

Firstly a tiny bit of background: I have a MEAN stack application running on Bitnami Ubuntu, on AWS. I have a .env file with API keys etc in it, that is excluded from my repo using .gitignore. I understand the main approaches to initialising the…
0
votes
1 answer

Issue in setting env Variable for Supervisor debian

I am using supervisorctl for running a program and environment variables to store the common variables. For setting Environment Variable I am using /etc/environment. I have added the following as environment variable: Foo=Bar Then I made sure the…
Sharvin26
  • 103
  • 1
  • 3
0
votes
1 answer

How to adjust the format of Win System Environmental variables “%date%”

I have a computer running Window Server 2008 R2 Standard. It runs several periodic tasks written by Windows cmd. Recently these batch jobs work improperly and i realize that the logic of the script was broken. It is because is this server when you…
0
votes
1 answer

Systemd service for a ruby rake job and environmental variables

I have many environmental variables that are required to run my ruby rake job. This job will be supervised by systemd. How can I export all the environmental variables? And also export them in such a way so that only my systemd service will see…
Maddani
  • 13
  • 1
  • 5
0
votes
1 answer

What are the rules regarding casing of values for environment variable USERNAME in Windows?

One of my customers says that in his AD usernames have mixed case sometimes and besides that, that people are able to successfully login using another casing of usernames. So there might be an ExampleUser in the AD and Windows allows them to login…
0
votes
2 answers

CloudFormation: How to export bash variable in the userdata so the vars would be available when the instance starts?

I wrote the following CloudFormation template: { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "company - LaunchConfiguration and AutoScalingGroup Template", "Parameters" : { "Vpc" : { "Type" :…
0
votes
0 answers

How to restrict outbound ssh username credential to current user only

Is there a method to disallow a user from changing their outbound ssh credentials? I.e. restrict ssh -l username ip.address or ssh username@ip.address Further clarification. Only allow the username of the current logged in user to use their…
0
votes
1 answer

Is it fine if an external program edit the sudoers file?

My program needs some local environment variables while running as root to perform certain tasks. Would it be fine to write a subroutine that can change users sudoers to keep these variables? It's not only going to run on my personal computer, it…
answerSeeker
  • 153
  • 1
  • 9
0
votes
2 answers

Call app with sudo and custom environment variable

I need to call sqlplus with oracle user sudo to clearly specified DB (env var ORACLE_SID) by one line command. The usual way to do it consists of 2 steps: $ sudo -u oracle -i $ ORACLE_SID=DBNAME sqlplus / as sysdba But I need to do it in one line…
0
votes
1 answer

Apache 2.4: Set user dependent environment variable

I just wondered if it's possible to set an environment variable depending on the basic authentication user. I tried the following versions, but none of them work (obviously none of them is documented either): SetEnvIf HTTP_USER "marco"…
0
votes
1 answer

How do I explicitly set %PATH% in System Variable or User Variable in command prompt in a persistent manner?

When you open sysdm.cpl -> Advanced -> Environment Variables. you can see that envs are divided into two section: one is User Variables, another is System Variables, they both have a variable PATH in them. Now if you run set inside the cmd prompt,…
0
votes
1 answer

apache2 not picking up TNS_ADMIN environmental variable

I am trying to set 2 environmental variables for use in apache: LD_LIBRARY_PATH TNS_ADMIN. I set these in: /etc/apache2/envvars The former is picked up and set correctly, but the latter is not. I've tried setting a few random variable names as…