Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save JeyDi/047520c88b7218803cef6d29784aba3c to your computer and use it in GitHub Desktop.

Select an option

Save JeyDi/047520c88b7218803cef6d29784aba3c 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