The very simple way to do this is to use the "eval" statement. What does "eval" do?
When the shell evaluates (=executes) a command line it does so in several stages. One stage is to "expand" the variables, meaning: replace the variables name by its content. For instance:
x="abc"
print - "$x"
The first step the shell takes is to replace the "$x" with its content. The line after this operation is:
print - "abc"
Only then the command is executed. "eval" restarts this process of expanding variables after it has already taken place (and before the execution of commands). For instance, the steps in "slow-motion":
x="abc"
abc="This is the content of abc."
eval print - \$$x
eval print - $abc # after first expansion: "\$" -> "$", "$x" expanded
print - This is the content of abc. # after eval: "$abc" expanded
That works the same way with arrays. The reason why you have to escape the "$" by backslashes is to protect them from being interpreted in the first run of the shell interpreter: otherwise the shell would read "$$" (which is a perfect shell variable, containing the PID) followed by "x", which is simply a character.
Coming back to your problem: If you want to get out "13" as result the line to execute is - not within awk, but on the command line or within a shell script:
mpgw=13
CATEGORY=mpgw
eval print - "\$CATEGORY"
Suppose you have several values and you want to select one:
mpgw=13
foo=14
bar=15
CATEGORY="mpgw" ; eval print - "\$$CATEGORY" # will yield "13"
CATEGORY="foo" ; eval print - "\$$CATEGORY" # will yield "14"
At last a remark as the moderator here: you might not be "damned", but you might be left alone and/or receive an infraction if you don't tone down your comments. All the people posting in this thread - especially vgersh99 - have been genuinely and sincerely trying to help you, so you have nothing to complain about.
It might be troublesome for *you* that your job is at stake, as you put it, but it is not our fault that you have a job for which you are lacking the necessary qualifications. We are generally inclined to help you along (like everybody else coming here), but first: we are volunteers, therefore rather "inclined" than "bound by duty" to do so; and second: it is *your* problem not to know something you should know, not *ours* that you might not understand our offerings.
bakunin