Questions tagged [env]
221 questions
187
votes
8 answers
Dockerfile - set ENV to result of command
Is it possible to set a docker ENV variable to the result of a command?
Like:
ENV MY_VAR whoami
i want MY_VAR to get the value "root" or whatever whoami returns

Sultanen
- 3,084
- 5
- 25
- 46
165
votes
11 answers
How do I keep track of pip-installed packages in an Anaconda (Conda) environment?
I've installed and have been using the Anaconda Python distribution, and I have started using the Anaconda (Conda) environment. I can use the standard conda install... command to put packages from the distribution into my environments, but to use…

gromiczek
- 2,970
- 5
- 28
- 49
120
votes
6 answers
Defining an array as an environment variable in node.js
I have an array that I pull data from.
festivals = ['bonnaroo', 'lollapalooza', 'coachella']
Since I'm using heroku, it may be better to replace it with an environment variable, but I'm not sure how to do that.
Is using a JSON string as an…

paranoidhominid
- 1,379
- 2
- 8
- 14
95
votes
10 answers
How do I find the name of the conda environment in which my code is running?
I'm looking for a good way to figure out the name of the conda environment I'm in from within running code or an interactive python instance.
The use-case is that I am running Jupyter notebooks with both Python 2 and Python 3 kernels from a…

Alnilam
- 3,121
- 2
- 21
- 22
67
votes
7 answers
env: python\r: No such file or directory
My Python script beak contains the following shebang:
#!/usr/bin/env python
When I run the script $ ./beak, I get
env: python\r: No such file or directory
I previously pulled this script from a repository. What could be the reason for this?

Niklas R
- 16,299
- 28
- 108
- 203
59
votes
6 answers
Mac OS: /usr/bin/env: bad interpreter: Operation not permitted
I'm trying to run this script on Mac OS 10.7 (Lion) and I'm getting the error:
$ bbcolors
-bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Operation not permitted
I've successfully run this script on other Macs of mine. It's just this…

Nick
- 3,172
- 3
- 37
- 49
50
votes
4 answers
rails 3, how use an ENV config vars in a Settings.yml file?
In my settings.yml file I have several config vars, some of which reference ENV[] variables.
for example I have ENV['FOOVAR'] equals WIDGET
I thought I could reference ENV vars inside <% %> like this:
Settings.yml:
default:
cv1: Foo
cv2: <%…

jpw
- 18,697
- 25
- 111
- 187
40
votes
10 answers
Use different PHP version CLI executable for one command
So I have Gentoo box with three PHP versions installed (nevermind the reasons):
/usr/bin/php -> /usr/lib64/php5.4/bin/php
/usr/bin/php5.5 -> /usr/lib64/php5.5/bin/php
/usr/bin/php5.6 -> /usr/lib64/php5.4/bin/php
I want to install Laravel framework…

roomcays
- 927
- 1
- 7
- 22
35
votes
13 answers
Laravel 5 - env local debug true no errors shown
I'm trying to enable the debug for my app but it looks like I don't have any feedback.
The environment is set to local (in the .env file) and if I run
php artisan env
I get this
Current application environment: local
The debug config for my local…

peppeocchi
- 814
- 1
- 9
- 22
30
votes
3 answers
How do I see the ENV vars in a Rails app?
I am taking over an old Rails app. No one has touched it in a year. The last developer left in April of 2015 and I have no way to contact him. I do have ssh access to the server, and I have access to the Github repo.
I don't know any of the…

lorm
- 3,141
- 3
- 15
- 20
24
votes
4 answers
.ENV file is visible
I am using Laravel 5.1
I recently uploaded my project in shared hosting. but when i browse http://siteAddress.com/local/.env my .env file is visible.
Is there any way to hide this file or redirect people if they want browse the site with folder…

smartrahat
- 5,381
- 6
- 47
- 68
24
votes
4 answers
Shell script shebang for unknown path
Is it possible to specify a shebang line without knowing the path of the program you want to do the executing?
maybe don't specify the path
#!node
or specify several options
#!/usr/local/bin/node
#!/usr/bin/node
Extra points for cross platform…

Billy Moon
- 57,113
- 24
- 136
- 237
19
votes
2 answers
Setting variables with spaces within .env
I have a .env file with a bunch of variables and I just came across an error.
One of the variables has spaces.
TEST="hello world"
So when I run this, learned about in this answer here.
env $(<.env)
I get this error.
env: world"': No such file or…

ThomasReggi
- 55,053
- 85
- 237
- 424
17
votes
4 answers
What's the difference of using #!/usr/bin/env or #!/bin/env in shebang?
Will there be any difference or it's just a personal choice?

Cheng
- 4,816
- 4
- 41
- 44
16
votes
4 answers
How to get environment of a variable in R
I was wondering if there is anyway to get the environment of a declared variable. Say I already have declared a variable to an environment and want to use that variable's environment to declare a few more variables. Something like getEnv("variable")

Avinash
- 2,521
- 4
- 21
- 35