How can I do the following in Unix:
1) Variable xxx_yyy=12345
2) Variable aaa=yyy
How can I evaluate xxx_$aaa to give me 12345.
Please advise.
In bash use indirect parameter expansion:
varname=xxx_$aaa
echo ${!varname}
However, dynamic variable names are usually tricky to handle. Easier to use an associative array:
declare -A xxx
xxx[yyy]=12345
aaa=yyy
echo ${xxx[$aaa]}