1

I have something like this:

$CORSAIR_TYPE="good"
$CASE="CORSAIR"
...
$local temp_type=${CASE}_TYPE
echo ${!temp_type}

This gives me the value of the variable CORSAIR_TYPE, which is "good". Is there a way of doing this without creating the temp_type variable? What would I replace echo ${!temp_type} with?

Thanks

Agustin Meriles
  • 4,762
  • 3
  • 29
  • 44
halexh
  • 2,881
  • 3
  • 18
  • 19

1 Answers1

0

For anyone else stumbling across this post, this is one way I found of doing it:

echo $(eval echo $`echo ${CASE}_TYPE`)
halexh
  • 2,881
  • 3
  • 18
  • 19