As well as John Kugelman's solution, you can use eval
like this:
x=10; for i in $(eval echo {1..$x}); do echo $i; done
Or, if $1 is 10, then:
set -- 10
for i in $(eval echo {1..$1})
do
echo $i
done
You could also use some variants on:
set -- 1000
eval echo {1..$1} |
while read i
do
echo $i
done
Or:
set -- 1000
while read i
do
echo $i
done <(eval echo {1..$1})
That uses process substitution.