#!/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