Using a variable's value as a variable name

To use the value stored in a shell variable as the name for another variable, use this syntax:

export $(echo $x)=hello

This will result in

echo $string

Here is another approach. Assume x is already assigned the value 'string' and string is assigned the value 'hello'.

eval value=\$$x
echo $value

This is useful, say, in a for loop, where you don't know what the value of the assigned to the first variable will be. See this for a discussion about this and some other syntax.