Created
March 22, 2016 21:19
-
-
Save jrbenito/2a9790df2c5c0b282dd5 to your computer and use it in GitHub Desktop.
This code will generate bash variables like $NameParameterNameSession for each item on INI file
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
while IFS='= ' read var val | |
do | |
if [[ $var == \[*] ]] | |
then | |
section=$var | |
elif [[ $val ]] | |
then | |
declare "$var$section=$val" | |
fi | |
done < ./filename.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment