On Wed, Apr 1, 2026 at 11:42 PM Invert Ignas <[email protected]> wrote:
>
> Fix:
>         Allow brace expansions to accept variables.

This is a matter of the order of expansions. Brace expansion is
performed before parameter and variable expansion, so it can't take
into account the value of a variable. This is documented in the
"EXPANSION" section of the manual.

If you'd like to get the effect of the variable expansion before the
brace expansion, you can always do something like this:
$ foo=3
$ eval "arr=( {0..${foo}} )"
$ for x in "${arr[@]}"; do
>   printf '%s\n' "${x}"
> done
0
1
2
3

Changing bash to make parameter and variable expansion occur before
brace expansion would break backwards compatibility in a big way.

Reply via email to