Thanks for your reply. I had an idea that eval would give me what I needed but the man page wasn't much help with the syntax.
Actually FYI, I actually had to reverse your suggestion to get what I wanted. What you suggested did not assign the input value to myvar1, 2, 3 and 4, but instead created a new variable named after the value and gave it a value of myvar 1,2,3 and 4, so for iteration 1 if I input "foo" it created a new variable ${foo} with a value of myvar1.
But many thanks for your help, you pointed me in the right direction! I have been tearing my hair out for a while over this one. Should have joined the forums days ago
Just for other newbies' (like me) reference the working code is as follows:
for i in 1 2 3 4
do
echo "Please enter value for iteration $i:"
read myvar
eval "myvar${i}=${myvar}"
done
This gives a variable called myvar${i} with whatever was read by the shell as a value, for each iteration.
Thanks very much!