I have the below config file : OO_CONF.conf with the below contents:
appPackage_name = sqlncli
appPackage_version = 11.3.6538.0
Now i want to r
Use the declare built-in in bash with -g flag to make it globally available,
#!/bin/bash
while IFS=' = ' read -r key value; do
declare -g $key="$value"
done <OO_CONF.conf
printf "%s %s\n" "${appPackage_name}" "${appPackage_version}"
The idea is to set the IFS to = so to split the lines in the file to read the key and value pairs and then with declare we can create variables on the fly with the below syntax
declare -g <var-name>=<variable-value>