Skip to content

Instantly share code, notes, and snippets.

@vindir
Forked from judy2k/parse_dotenv.bash
Created November 24, 2020 07:06
Show Gist options
  • Save vindir/2ab5570ca6c3f52622fd3db0ee45a0f8 to your computer and use it in GitHub Desktop.
Save vindir/2ab5570ca6c3f52622fd3db0ee45a0f8 to your computer and use it in GitHub Desktop.

Revisions

  1. @judy2k judy2k created this gist Mar 22, 2017.
    5 changes: 5 additions & 0 deletions parse_dotenv.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # 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)