0

I have "INSTALLMODE=BASIC" key value pair defined in my config file. And, I am splitting these key value pairs and assigning them as below.

INSTALLMODE=BASIC
key=INSTALLMODE
x=`echo $key`

Now, I want to get value of $x as BASIC. How could I do that.

Thank you.

Ras
  • 543
  • 1
  • 9
  • 25
  • Or maybe `INSTALLMODE=BASIC; key="$INSTALLMODE"; x="$key"` (however convoluted it may be)? –  Jul 25 '19 at 21:00
  • Key should have keyname only, as I am using it for comparison at different place. I need a new variable with value of keyname. – Ras Jul 25 '19 at 21:21
  • 1
    In addition to the linked duplicates, see the detailed discussion in [BashFAQ #6](http://mywiki.wooledge.org/BashFAQ/006). – Charles Duffy Jul 25 '19 at 21:27
  • Fantastic. y="${!x}" worked. Thanks Charles. – Ras Jul 25 '19 at 22:25

0 Answers0