0

I am experiecing a quite wierd situation.

I have the following .env file:

REGION=europe-west1
MULTIREGION=EU
DATASET=desconexion_digital
BUCKETNAME=desconexion-digital-files
SENT_EMAILS_TOPIC=desconexiondigitalemailingestion

When I load the environment variables to my bash session and print BUCKETNAME variable, I get the following:

$ source .env
$ echo $BUCKETNAME
  desconexion-digital-files

However, when I try to format my variable into a string, I get the following:

$ echo gs://$BUCKETNAME/templates
  /templatesnexion-digital-files

The output I was expecting was gs://desconexion-digital-files/templates.

I made a comprobation to check if my syntax was correct, and I overwrote the variable the following way:

$ BUCKETNAME=desconexion-digital-files
$ echo gs://$BUCKETNAME/templates
  gs://desconexion-digital-files/templates

and then I got the expected output. It seems the problem is when I load the variable from a .env file using the source command. Any idea how should I declare the variable?

Luiscri
  • 661
  • 5
  • 27
  • There are no **environment** variables involved in your question. You define shell variables, but I don't see that you would put them into the environment. Aside from this, I don't see the reason why you want the stuff in your environment; the whole question can also be discussed in terms of plain shell variables. – user1934428 Aug 02 '21 at 10:15

0 Answers0