Hi,
I have a config file like below:
Code:
config.cfg
==========
PARAm_1_MIN=20
PARAM_1_MAX=40
PARAM_2_MIN=3
PARAM_2_MAX=40
PARAM_3_MIN=0
PARAM_3_MAX=4.5
.....
...
...
PARAM_N_MIN=20
PARAM_N_MAX=30
I need to write a shell script which reads this file and generated a variable PARAM_1 = (PARAM_1_MIN + PARAM_1_MAX)/2
Code:
for entry
PARAM_1_MIN = 30
PARAM_1_MAX = 60
I should have a variable ( can be an array) PARAM_1 or PARAM[1]= (PARAM_1_MIN + PARAM_1_MAX)/2
and so for all the other PARAMETERS in the config.cfg file. based on the number of arguments we have we should generated
so many variables in the shell script.
Could someone please help me how to do this.
Thanks
Sachin