Skip to content

Instantly share code, notes, and snippets.

@kenwoodjw
Forked from judy2k/parse_dotenv.bash
Created November 16, 2018 06:44
Show Gist options
  • Save kenwoodjw/b121c7a8c2dd743110aecf39a7b04d24 to your computer and use it in GitHub Desktop.
Save kenwoodjw/b121c7a8c2dd743110aecf39a7b04d24 to your computer and use it in GitHub Desktop.
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment