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
| ### Keybase proof | |
| I hereby claim: | |
| * I am Raellan on github. | |
| * I am raellan (https://keybase.io/raellan) on keybase. | |
| * I have a public key whose fingerprint is D9E3 5659 0051 E1EF 6925 4462 BB81 6108 C513 EB2C | |
| To claim this, I am signing this object: |
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
| cfg.parser () { | |
| fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '=' | |
| IFS=$'\n' && ini=( $fixed_file ) # convert to line-array | |
| ini=( ${ini[*]//;*/} ) # remove comments | |
| ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix | |
| ini=( ${ini[*]/%]/ \(} ) # convert text2function (1) | |
| ini=( ${ini[*]/=/=\( } ) # convert item to array | |
| ini=( ${ini[*]/%/ \)} ) # close array parenthesis | |
| ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2) | |
| ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis |
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
| cfg.parser () { | |
| fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '=' | |
| IFS=$'\n' && ini=( $fixed_file ) # convert to line-array | |
| ini=( ${ini[*]//;*/} ) # remove comments | |
| ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix | |
| ini=( ${ini[*]/%]/ \(} ) # convert text2function (1) | |
| ini=( ${ini[*]/=/=\( } ) # convert item to array | |
| ini=( ${ini[*]/%/ \)} ) # close array parenthesis | |
| ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2) | |
| ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis |