echo the NAME of the variable

#!/bin/bash
varA="AAA1"
varB="BBB2"
varC="CCC3"
for proccx in $varA $varB $varC
do
echo "the current name is ????? , the value is $proccx"
echo " "
done
#end of script

I want the output to look something like this:

the current name is varA, the value is AAA1

the current name is VarB, the value is BBB2

the current name is varC, the value is CCC3

Use two arrays, or associative arrays (bash v4), or write them out again (you already did in the loop), or printf like so:

[mute@geek ~]$ varA=AAA1 varB=BBB2 varC=CCC3
[mute@geek ~]$ printf 'the current name is %s, the value is %s\n' varA "$varA" varB "$varB" varC "$varC"
the current name is varA, the value is AAA1
the current name is varB, the value is BBB2
the current name is varC, the value is CCC3

---------- Post updated at 12:46 PM ---------- Previous update was at 12:45 PM ----------

or bash's indirection:

$ for var in varA varB varC; do echo "$var is ${!var}"; done
varA is AAA1
varB is BBB2
varC is CCC3

typing them out again is really not an option. I was hoping for a slick way to do this. I think I need to research arrays

All I seem to be able to do is echo the value of the variable, which makes sense because that is what I am passing to the for loop. maybe the answer lies in how the variable is inistially set. I dont know

Did you see my post update about indirection? In this way you actually pass variables names rather than values, and use the special ${!} notation to expand the value of the variable inside the variable ...

edit: oh nevermind, saw your title "hundreds of vars"... indeed an array is the way to go. target is bash3 or bash4? with bash3 you'd need two separate arrays, one would keep the "key" and the other the "value",
in bash4 you have associative arrays, such that array[key]=val. example for bash3:

[mute@geek ~]$ keys=(varA varB varC varD)
[mute@geek ~]$ vals=(AAA1 BBB1 CCC1 DDD1)
[mute@geek ~]$ for i in "${!keys[@]}"; do echo "${keys} = ${vals}"; done
varA = AAA1
varB = BBB1
varC = CCC1
varD = DDD1

If you can get a delimiter char that isn't in the data or the variable name you could store var and value in 1 array under bash3:

Eg using : char

[chubler@unix.com ~]$ vars=(varA:AAA1 varB:BBB2 varC:CCC3 varD:DDD1)
[chubler@unix.com ~]$ for val in "${vars[@]}" ; do echo "${val%:*} = ${val#*:}"; done
varA = AAA1
varB = BBB2
varC = CCC3
varD = DDD1

Try:

#!/bin/bash
varA=AAA1
varB=BBB2
varC=CCC3
for proccx in varA varB varC
do
  echo "the current name is $proccx, the value is ${!proccx}"
  echo " "
done

or POSIX:

varA=AAA1
varB=BBB2
varC=CCC3
for proccx in varA varB varC
do
  eval echo "\"the current name is $proccx , the value is \${$proccx}\""
  echo " "
done