Skip to content

Instantly share code, notes, and snippets.

View the-REAL-beautysleep's full-sized avatar

beautysleep the-REAL-beautysleep

View GitHub Profile
@mihow
mihow / load_dotenv.sh
Last active July 25, 2024 04:35
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