Possible Duplicate:
How do I iterate over a range of numbers in bash?
I am trying to print “Hello World!” 10 times via the code below, but it is printed only one time. Where am I missing the correct syntax?
RUNS=10
for RUN in {1..$RUNS}
do
echo "Hello World!"
done
You want to do a brace expansion, but bash does not do double-expansion (it needs to expand
$RUNS). You can force double-expansion byBut I suggest you avoid this mess like the plague and just do
or