Skip to content

Instantly share code, notes, and snippets.

@apolopena
Last active March 25, 2023 11:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save apolopena/fbeb2ae1ae6e0fd83ccbc14984fb3b4b to your computer and use it in GitHub Desktop.
Save apolopena/fbeb2ae1ae6e0fd83ccbc14984fb3b4b to your computer and use it in GitHub Desktop.
Set and unset environment variables from an .env file
# 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