1 min read

TIL: How to Export .env Variables to the Current Shell

Everything is Docker with lots of .env variables I need exported into the current shell environment

Everything is Docker with lots of .env variables I need exported into the current shell environment.

This does the trick.

export $(cat .env | xargs )

(Yes, there's also the dotenv gem.)