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 directory
How do I set variables with spaces within .env?
env "$(<.env)"
– Zaragozaenv "$(<.env)" echo $TEST
seems to print a blank line. – Unwise$TEST
is done before runningecho
in the current shell which does not have theTEST
variable set. Whenecho
is run,TEST
is set, butecho
does not know what to do with$TEST
. – Klapp