-
-
Save wernersmit/be740187d4d0639dc49e3ebea2fc9773 to your computer and use it in GitHub Desktop.
Import variables from .env file for a bash script
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
| PROGRAM_NAME=Used | |
| #PROGRAM_NAME=Ignore |
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
| #!/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