Re: BUG: Brace expansions do not support any type of variable.
Zachary Santer <[email protected]> Thu, 2 Apr 2026 00:52:05 -0400
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Message-ID | <CABkLJUKOjyQ=MUyVDchLEiwschbz+=5STXOTVhHtsrwduLyjOA@mail.gmail.com> |
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.