This, of course, works:$ echo {1..5}1 2 3 4 5But when i attempt to substitute the number 5 with a variable, this no longer works:$ f=5; echo {1..$f}{1..5}$ f=5; echo {1..${f}}{1..5}$ f=5; echo {1..f}{1..f}Is there a way to substitute the number within a variable before the {#..#} construct is parsed?
How do i use a variable to construct a sequence?
bash
There is a way::~# f=5 ; eval echo {1..$f}1 2 3 4 5Alternative::~# f=5 ; echo `seq 1 $f`1 2 3 4 5