I am trying to set a variable that set the number of for loops in bash.
Hi, I am trying to set a variable that set the number of for loops in bash.
#!/bin/bash
num_loops=3
for i in {1.."$num_loops"}
do
echo $i
done
However I got as output this:
{1..3}
Instead I would like this output:
1
2
3
I am not an expert in bash, but it ooks to me that the variable num_loops has become a string? Can someone explain me this? Thanks