Referencing variable using another variable

Hello, I am new to shell scripting so this might be a simple question...also, please excuse me if this is a topic discussed before.

I have declared a bunch of variables as such:
Host_1=32
Host_2=33
Host_3=34
temp=1
numUsers=4

Now, I am trying to go through a loop to access each of these variables. I have established a while loop like so:

while [ $temp -le numUsers]
do
echo "Host 1 = $Host_"$temp""
temp='expr $temp + 1'
done

Now this obviously is incorrect, as it looks for a variable called Host_ and doesn't find it, leaving me with only the value of temp being printed. Is there a way to have it so Host_1 is printed with temp=1? I looked into using an array but I figure there might be a quick solution to this.

The shell supports arrays example for korn shell:
assume host_1 host_2 and host_3 are defined -

set -A arr $host_1 $host_2 $host_3
let tmp=0
while [[ $tmp -lt ${#arr[@]} ]]
do
       echo ${arr[tmp]}
       tmp=$(( tmp +1 ))
done

to create an array in bash use declare -a arrayname_goes_here

I tried your code and it runs fine until ' echo ${arr[tmp]} '

I am using the standard shell script though. Are arrays not supported in it or is there something else I am overlooking? I am getting a bad substitution error by the way.

I found the way I originally intended in another thread after further searching.
I just needed to use

eval echo " \$Host_$temp".

Your response was appreciated.

If you are using ksh93, rather thanusing eval, you can use name references

#!/usr/bin/ksh93

Host_1=32
Host_2=33
Host_3=34

numUsers=4

for ((temp=1; temp < numUsers; temp++))
do
    typeset -n x=Host_$temp
    print $x
done