Skip to content

Instantly share code, notes, and snippets.

@aelindeman
Created February 19, 2020 14:05
Show Gist options
  • Save aelindeman/ea919e05cc1aa5d5c6159f5fa20b7412 to your computer and use it in GitHub Desktop.
Save aelindeman/ea919e05cc1aa5d5c6159f5fa20b7412 to your computer and use it in GitHub Desktop.
bash script to export all key=value pairs in a file as environment variables to the terminal
#!/usr/bin/env bash
exportall() {
export $(grep -v '^#' "${1:-.env}" | xargs)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment