I'm trying to compose up a docker-compose file and there is one step where I ran grep -v '^#' .env
to get all the uncommented lines from .env
file to set environment variables.
In the .env
file, it looks like this
DB_ENGINE=django.db.backends.postgresql
However, after running grep -v '^#' .env
and I check the environment, variable DB_ENGINE
has value of "django.db.backends.postgresql\r"
(notice the trailing \r
there).
How can I overcome this? I've been doing this for a long time and it has never happened before.