How can I read an .env file and set the variables as bash variables? Currently, I'm able to read it and export them as environment variables.
If the file contains the variables:
DB_NAME=mydb
DB_PASSWORD=abcd1234
Then, DB_NAME and DB_PASSWORD will be bash variables and they will contain the respective values.
PASSWORD=abcd;1234is a valid .env file but would not work in bash withsource(it'd read just 'abcd') – istepaniuk Feb 20 '23 at 20:16