Created
March 6, 2021 11:53
-
-
Save andgineer/649cf11bf8af092c886857b8abc79a9e to your computer and use it in GitHub Desktop.
Substitute placeholders in config like ${name} with all env vars defined in current session
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
for VAR in $(compgen -e); do | |
# to work in zsh replace `${!VAR}` with `${(P)VAR}` | |
sed -i 's|${'$VAR'}|'"${!VAR}"'|g' /config.yml | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment