Skip to content

Instantly share code, notes, and snippets.

View StepanKuksenko's full-sized avatar

Stepan Kuksenko StepanKuksenko

View GitHub Profile
@mihow
mihow / load_dotenv.sh
Last active May 28, 2025 13:01
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