This one is probably pretty simple. I've got a simple while loop which asks the user to input data
while [ $i -le $numMasterNodes ]; do
    echo "Enter hostname #$i: "
    read masterHost$i
    ((i+=1))
done
I'm trying to get the value of $masterHost$i in my loop, for example
while [ $i -le $numMasterNodes ]; do
    echo "Enter hostname #$i: "
    read masterHost$i
    echo $masterHost$i
    ((i+=1))
done
However, it just returns 1 2 3, etc... How can I get the value of $masterHost$i so I can add it to an array?
Thanks!
 
    