Dynamic Variable Declatation

Evening all,

Have been trying to create the following environment variable:

${MD_SYSTEM}_ZZ_EMAIL_SUPPORT="myname@domain.com"

However when the script that contains the above is executed it returns:

ksh: MDQA_ZZ_EMAIL_SUPPORT=myname@domain.com: not found

Is what I'm trying to do possible ??
Will save me a huge headache if it is.

Cheers,
Cameron

#!/bin/ksh

MD_SYSTEM='aa'

eval export \${MD_SYSTEM}_ZZ_EMAIL_SUPPORT="myname@domain.com"

echo "$aa_ZZ_EMAIL_SUPPORT"

Many thanks for the reply vgersh99.

In the last of my environment files I included your suggestion:

eval export \${MD_SYSTEM}_ZZ_EMAIL_SUPPORT="myname@domain.com"

Incidently, ${MD_SYSTEM} is established by another environment file prior.

In my scripts I updated the case statements where they are to be applied:

ZZ) EMAIL_WHO=${MD_SYSTEM}_ZZ_EMAIL_SUPPORT ;;

And hey-presto, a quick test of the script & I got my email.
You have just saved me a minimum 8-10 hrs of rewrites and amendments. And makes their application within future scripts high as this will allow me to write more generic scripts for the six environments we have here (1 script to be applied to each environment - sweet).

HUGE THANKS :smiley: