6

I need to export a lot of variables like export x1=1 export x2=2

I moved all variables in file .env and tried

source .env

After it I executed

printenv

and all of this variables were absent in the list of env variables. Also I tried export $(xargs <.env) But I have commented lines in .env file and I got following messages

#': not a valid identifier

So how can I export variables from file and skip commented lines?

iPogosov
  • 367
  • 1
  • 6
  • 15

1 Answers1

-3

Try naming a file like variables.env and then try export variables.env echo $somevariable_name