How can I use a variable within a ".." range, as in {1..${num_lanes}}?

28 Views Asked by At

If I print out a loop with fixed values like so:

for i in L0{1..4}
do
    echo $i
done

I get the desired output:

L01
L02
L03
L04

However, if I try to use a variable:

for i in L0{1..${num_lanes}}
do
    echo $i
done 

I get:

L0{1..4}

How can I use a variable within curly braces?

0

There are 0 best solutions below