Skip to content

Instantly share code, notes, and snippets.

View stefankuksenko's full-sized avatar

Stefan Kuksenko stefankuksenko

View GitHub Profile
@mihow
mihow / load_dotenv.sh
Last active October 20, 2025 01:05
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