Created
December 17, 2020 14:58
-
-
Save tadpol/fb1fd25d14feb6f568d60378f6d4b217 to your computer and use it in GitHub Desktop.
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
# convert INI to sourcable env. (does not handle comments) | |
awk 'BEGIN {sec="default"}; /^\[/ {gsub(/\[|\]/,""); sec=$0} /=/ {print sec "_" $0}' < config.ini | |
# Filter in a single section (does not handle comments) | |
awk -v sec=dev 'BEGIN {nskip=0} /^\[.+\]$/ {if($0 == "[" sec "]") nskip=1; else nskip=0; next} nskip' < config.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment