Forked from apolopena/bash-set-and-unset-env-from-file.sh
Created
June 23, 2022 15:15
-
-
Save JeyDi/047520c88b7218803cef6d29784aba3c to your computer and use it in GitHub Desktop.
Set and unset environment variables from an .env file
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
| # set environment vars from an .env file | |
| export $(grep -v '^#' .myenvfile | xargs) | |
| # unset environment vars from an .env file | |
| unset $(grep -v '^#' .myenvfile | awk 'BEGIN { FS = "=" } ; { print $1 }') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment