Created
December 2, 2020 05:55
-
-
Save justinmklam/bc3e8a01e1b7d80c14acb7e0d3af5433 to your computer and use it in GitHub Desktop.
Export a file of env variables. Source: https://unix.stackexchange.com/a/79077
This file contains hidden or 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
## Option 1 | |
# Set all variables to be automatically exported | |
set -a | |
# '.' is the standard way to source variables. 'source' is available in most Bourne shells | |
. .env | |
# Disable automatic export | |
set +a | |
# Option 2 (for POSIX shells) | |
set -o allexport | |
source .env | |
set +o allexport |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment