Storing bash output into a variable using eval

bash

Solution

Like this:

eval c=\$$var

a better, safer way is to use indirection:

c=${!var}

Problem

I have a line of code ``` eval echo \$$var ``` which prints a string. How can I store this string into a variable?

Original source