Last active
December 20, 2022 02:59
-
-
Save fcoclavero/954c2ee064cbbb92ee4af0af2e8b5a3a to your computer and use it in GitHub Desktop.
Envfiles
This file contains 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
# Get value on variable in .env file | |
cat .env | grep $VAR_NAME | sed 's/.*=//' |
This file contains 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
# Output contents of .env joined by comma | |
cat .env | tr '\n' ',' | rev | cut -c2- | rev # cut works on preceding characters, thats why we reverse twice to remove last two characters from tr, which include a trailing comma |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment