Skip to content

Instantly share code, notes, and snippets.

@eirenik0
Created March 14, 2019 09:59
Show Gist options
  • Save eirenik0/e297a0298624907d29e5c4cc827ebe7f to your computer and use it in GitHub Desktop.
Save eirenik0/e297a0298624907d29e5c4cc827ebe7f to your computer and use it in GitHub Desktop.
Load ENV variables from .env file using `dotenv` package
#!/usr/bin/env bash
IFS=$'\n'
for line in $(cat .env); do
if [[ $line != \#* ]] ; then
eval 'export $line'
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment