Here is my code
bash-3.2$ read num
100
bash-3.2$ for k in {1..$num}
> do
> echo Printed $k times
> done
{1..100}
bash-3.2$ echo $num
100
bash-3.2$ echo $k
{1..100}
Does anyone have any idea why it is doing this? It isn't the variable num
that's wrong because I checked that with my echo
at the end.