Enviornment Variable in B shell (I call it nested variable)

#!/bin/sh

APP_ROOT_MODE1=/opt/app1.0
APP_ROOT_MODE2=/opt/app2.0

APP_ROOT=${APP_ROOT_${APP_MODE}}


# enviornment variable APP_MODE will be exported in the terminal where 
# we run the applciation,  its value is string - MODE1 or MODE2  
# My intension is:
# when export APP_MODE=MODE1 in terminal,  APP_ROOT is /opt/app1.0
# when export APP_MODE=MODE2 in terminal,  APP_ROOT is /opt/app2.0

But the script above does not work? Any grammar error? Any trick?

Thanks in advance

Does not work

What does not work - what's the error output?

This here does not look as if it works:

Try

APP_ROOT=${APP_ROOT}_${APP_MODE}

The erorr message is
line 24: ${APP_ROOT_${APP_MODE}}: bad substitution

BTW, ${APP_ROOT}_${APP_MODE} is not my intention.

eval APP_ROOT=\${APP_ROOT_${APP_MODE}}

Thanks, Annihilannic. Yes it works.