version=$(awk -F "=" '/database_version/ {print $2}' parameters.ini)
read_ini_file() {
local session=$1
local key=$2
local file=$3
awk '/^\[.*\]$/{session=$0}/=/{print session $0}' $file \
| grep '^\['$session'\]'$key'=' \
| perl -pe 's/.*=//'
}
# read "filename.ini" for "[session2] property" lines
# i.e. session1 session2.
result=$(read_ini_file session1 property filename.ini)