Skip to content

Instantly share code, notes, and snippets.

View camflan's full-sized avatar

Camron Flanders camflan

View GitHub Profile
@camflan
camflan / load_dotenv.sh
Created February 11, 2025 20:39 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a