Created
November 2, 2021 13:42
-
-
Save toloco/5cafe4aae31efc9e30c1a8062f9eebdd to your computer and use it in GitHub Desktop.
Load .env file in shellscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function load_env(){ | |
if [ -f $1 ] | |
then | |
export $(cat $1 | sed 's/#.*//g' | xargs) | |
else | |
echo "Can't find file" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment