Skip to content

Instantly share code, notes, and snippets.

@theothermattm
Created June 3, 2022 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theothermattm/7b7001cbe50594672311a48ca4f33a8c to your computer and use it in GitHub Desktop.
Save theothermattm/7b7001cbe50594672311a48ca4f33a8c to your computer and use it in GitHub Desktop.
Bash: Load environment vars from .env file
# Load Environment Variables from .env
if [ -f .env ]; then
export $(cat .env | grep -v '#' | sed 's/\r$//' | awk '/=/ {print $1}' )
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment