I want to name the variable as a_${v} .
for example: v maybe 2013 2014
Now I declare a_${v} variable
a_${v}=hI
therefore a_${v}=Hello # a_2014 must be Hello
I tried to use the eval command, although it does not throw an error when assigning a value, but I cannot extract the value of the variable name
$ v=2013 $ eval a_${v}=Hi $ v=2014 $ eval a_${v}=Hello echo ${a_${v}}
does not work..: (
I use bash and I do not want to change the variable name ie dn't want to assign a value to another value
source share