Questions tagged [env]
221 questions
1
vote
2 answers
Unix: Why doesn't env A=42 echo ${A} work?
The env man page says that it'll set the specified environment variables and then run the specified command. Knowing that, I'd expect
env A=42 echo ${A}
to print 42, but it shows nothing instead. What am I doing wrong?

Martin
- 940
- 6
- 26
1
vote
2 answers
Set env variable from BASH script
I need make something like
$ source /etc/environments # called in bash.sh script
Of course after script finished no changes apply to shell.
I know this is tricky if because child process cant modify parent 'bash' process. But May be another way to…

M_F
- 406
- 7
- 16
1
vote
1 answer
Is .env file necessary on a webserver?
I noticed when testing around with test projects on a remote server that I was required to create an .env file.
With my non test project I'm planning to deploy I have the .env file missing but everything still works.

Terraform
- 27
- 1
- 5
1
vote
2 answers
Get environment specific configuration from a JSON object using Lodash
Given that I have the following JSON object,
dbConfig = {
"db": "default",
"default": {
"defaultDB": "sqlite",
"init": "init",
"migrations": {
"directory": "migrations",
"tableName":…

nixgadget
- 6,983
- 16
- 70
- 103
1
vote
1 answer
Convert JSON to bash environment variables
I wrote this beauty a while back to run on a server and convert environment variables from JSON to a bash .env format.
#!/usr/bin/env node
var strings = []
process.stdin.resume()
process.stdin.setEncoding('utf8')
process.stdin.on('data',…

ThomasReggi
- 55,053
- 85
- 237
- 424
1
vote
1 answer
Restarting Apache Inside Docker and Keeping Environment Variables
Context
I'm using environment variables with docker to configure my applications. This way a single built image can serve many different users who will need different configurations.
When developing, I often enter the container and perform a few…

Programster
- 12,242
- 9
- 49
- 55
1
vote
1 answer
How can I define my ENV variables once in the DockerFile and pass them down to my spark image which is submitted by a supervisord managed script?
I am building some Docker Spark images and I am a little puzzled on how to pass environment (ENV) variables defined in the DockerFile all the way down into the container via "run -e", on into the supervisord and and then into the spark-submit shell…

Dave McLure
- 839
- 1
- 8
- 10
1
vote
1 answer
Rspec/Sinatra Modular vs Classical styles
All was well with my app until I refactored it into multiple controllers/server.
I believe I am using the modular set up with Sinatra-Base. I believe I have defined my Rack ENVs right.
I have a problem. I cannot run rspec without starting up…

Viola Crellin
- 61
- 2
- 8
1
vote
1 answer
Using host env variable with docker remote API
I'm trying to use the target host's env variable to parametrize my container when launching it with the remote API, but none of these worked ...
"Env": [
"ENV_VAR=`$TEST`",
"ENV_VAR2=$TEST"
],
Does anyone have an idea how to…

pedro
- 11
- 2
1
vote
2 answers
Enviroment variable can not be changed in docker container
docker run -e HOST_IP:xxxx
And I use the cmd to check if env HOST_IP changed:
docker exec CONTAINER_ID env |grep HOST_IP
I found it not changed after these tries:
docker exec CONTAINER_ID bash -c 'export HOST_IP=XXX'
docker exec CONTAINER_ID bash…

whi
- 2,685
- 6
- 33
- 40
1
vote
1 answer
Meteor: process.env.MAIL_URL sensitive info
I'm sending email verifications for my meteor app but I'm also uploading the app to github. I have the following code:
if (Meteor.isServer) {
// This code only runs on the server
Meteor.startup(function () {
// code to run on server at…

Barry Michael Doyle
- 9,333
- 30
- 83
- 143
1
vote
1 answer
How to get the value of env file in rails app?
I have installed a rails app using the rails composer. I selected .env with foreman. In my .env file I have:
OMNIAUTH_PROVIDER_KEY=key
and I am trying to get its value.
But, when I ran ENV["OMNIAUTH_PROVIDER_KEY"] I got nil.
What am I doing…

Raaz
- 1,669
- 2
- 24
- 48
1
vote
2 answers
Meteor with dotenv package for environment variables: "process" is not defined
I'm adding security for my API keys with the Meteor package dotenv: https://github.com/okgrow/meteor-dotenv
as per instructions, I:
1. created a file named ".env" in my root
2. entered two keys in the style "THIS_KEY=BLAH12345" in the file
3. made a…

Joe Riezner
- 61
- 6
1
vote
1 answer
env with variable setting and python is stuck
Not sure why but:
/usr/bin/env IPYTHONDIR=/tmp/.ipython python
when running from command line works fine. But stuck as a shabang line:
#!/usr/bin/env IPYTHONDIR=/tmp/.ipython python
Environment:
Debian 7.8 x86
Anybody has ideas why?

Sergey
- 978
- 2
- 11
- 33
1
vote
1 answer
Can't set node.js env
I'm using windows 7. I try to use SET NODE_ENV="development" command from cmd but this won't help. Also in npm in scripts I use NODE_ENV=development node app.js. But env still undefined.

Oleg Baranovsky
- 368
- 5
- 22