0

I have a cfg file whose content is like below:

input.cfg:

a_tag=ABC
b_tag=DEF

I have a shell script like below:

source input.cfg


update_input() {
local tag_id=$1
local tag_replace=${tag_id}_tag

echo ${tag_replace}
}

input_list="a b"

for input in ${input_list}
do
    update_input ${input}
done

Here I get the below output:

a_tag
b_tag

However I need to get the output as ABC and DEF as defined in input.cfg and cannot figure out a way to do the same. Can someone help, thanks!

Rog Matthews
  • 3,147
  • 16
  • 37
  • 56

0 Answers0