In BASH, is it possible to expand a variable in a brace expansion?
For instance, if one would like to obtain a printed sequence 1 to 10, they could do:
echo {1..10}
let's say that instead of 10, I have a variable rangeEnd
and would like to use that instead. Something along the lines of:
rangeEnd=10
echo {1..$rangeEnd}
This however produces {1..10}
as opposed to 1 2 3 4 5 6 7 8 9 10
. Is there any way to obtain the correct sequence (1 2 3 4 5 6 7 8 9 10
) using curly brace expansion?
(I'm already aware that I can use echo $(seq 0 $(rangeEnd))
, but I'd like to see if it is indeed possible to use curly brace expansion)