Creating a string variable name from the value of another string
- by NeonGlow
In my bash script I have two variables 'CONFIG_OPTION' and 'CONFIG_VALUE' which contain string VENDOR_NAME and Default_Vendor respectively.
I need to create a variable with name '$CONFIG_OPTION' ie VENDOR_NAME and assign the value in CONFIG_VALUE to newly created variable.
How I can do this?
I tried
$CONFIG_OPTION=$CONFIG_VALUE
But I am getting an error on this line as
'./Build.bash: line 137: VENDOR_NAME="Default_Vendor": command not found'
Thanks.