Skip to content

Instantly share code, notes, and snippets.

@wernersmit
Created September 12, 2018 12:29
Show Gist options
  • Select an option

  • Save wernersmit/be740187d4d0639dc49e3ebea2fc9773 to your computer and use it in GitHub Desktop.

Select an option

Save wernersmit/be740187d4d0639dc49e3ebea2fc9773 to your computer and use it in GitHub Desktop.
Import variables from .env file for a bash script
PROGRAM_NAME=Used
#PROGRAM_NAME=Ignore
#!/bin/bash
# Import .env variables.
export $(egrep -v '^#' .env | xargs)
echo $PROGRAM_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment