I have a bash file setting up a postgres-database.
#configure_db.sh
source ./secrets/sqlpassword.sh
createdb -U myuser mydatabase
I have a simple bash file exporting the password
#secrets/sqlpassword.sh
export PGPASSWORD='mypassword'
The rest of the node server uses environment variables saved in a .env-file. For the sake of order and simplicity i would want my postgres password stored in the same file:
//.env
postgrespassword='mypassword'
How can you import a variable from a .env-file to as bash-file?
Is there another way of solving the above?