Source .env file in Bash

Nov 12, 2025

It is easy to evaluate a .env file in bash; no real need for the dotenv command:

# enable automatic export of variables
set -a    # equivalent to: set -o allexport

# evaluate content in current shell
. .env

# disable automatic export
set +a