Skip to content

Instantly share code, notes, and snippets.

@jrbenito
Created March 22, 2016 21:19
Show Gist options
  • Save jrbenito/2a9790df2c5c0b282dd5 to your computer and use it in GitHub Desktop.
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
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