Answer the question
In order to leave comments, you need to log in
How to set global variables?
the .env file contains an environment variable (one for example):
HOST=localhost:3336
the set_env.sh script "should" make the variables global:
#!/bin/bash
source .env && export $(cut -d= -f1 .env)
Answer the question
In order to leave comments, you need to log in
$ cat env_file
HOST=foo
$ export `cat env_file`
or
$ env `cat env_file`
The only way:
source .env
echo $HOST
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question