I am trying to access different versions of an environment variable based on the contents of another variable.
I have tried concatenating the two like below but the order in which they are evaluated does not seem right, is this possible? Or is there a better way of approaching this problem?
MY_VARIABLE_TEST=testVar
MY_VARIABLE_LIVE=liveVar
ENVIRONMENT=TEST
# expecting target to equal testVar
TARGET=$MY_VARIABLE_${ENVIRONMENT}
Thanks in advance for any help