{0} is no expansion
{0,} is
it must be 2+

On Thu, Mar 6, 2025, 7:40 PM Trond Endrestøl via Bug reports for the GNU
Bourne Again SHell <bug-bash@gnu.org> wrote:

> $ bash --version
> GNU bash, version 5.2.37(0)-release (amd64-portbld-freebsd14.1)
> Copyright (C) 2022 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> $ echo devel/llvm{1{1,2,3,4,5,6,7,8,9},2{0}}
> devel/llvm11 devel/llvm12 devel/llvm13 devel/llvm14 devel/llvm15
> devel/llvm16 devel/llvm17 devel/llvm18 devel/llvm19 devel/llvm2{0}
>
> $ echo devel/llvm{1{1,2,3,4,5,6,7,8,9},2{0,1}}
> devel/llvm11 devel/llvm12 devel/llvm13 devel/llvm14 devel/llvm15
> devel/llvm16 devel/llvm17 devel/llvm18 devel/llvm19 devel/llvm20
> devel/llvm21
>
> I didn't expect the curly braces at the end of the first example. It
> should produce devel/llvm20 in my opinion. Everything is fine as long
> as the number of elements are > 1.
>
> csh(1) in FreeBSD gives the expected expansion for both examples:
>
> $ echo devel/llvm{1{1,2,3,4,5,6,7,8,9},2{0}}
> devel/llvm11 devel/llvm12 devel/llvm13 devel/llvm14 devel/llvm15
> devel/llvm16 devel/llvm17 devel/llvm18 devel/llvm19 devel/llvm20
>
> $ echo devel/llvm{1{1,2,3,4,5,6,7,8,9},2{0,1}}
> devel/llvm11 devel/llvm12 devel/llvm13 devel/llvm14 devel/llvm15
> devel/llvm16 devel/llvm17 devel/llvm18 devel/llvm19 devel/llvm20
> devel/llvm21
>
> --
> ----------------------------------------------------------------------
> Trond Endrestøl                   |       trond.endres...@ximalas.info
> Member of ACM, NAS, NUUG          |       FreeBSD 14.2-S & Alpine 2.26
>
  • Possible b... Trond Endrestøl via Bug reports for the GNU Bourne Again SHell
    • Re: P... microsuxx
      • R... Lawrence Velázquez
        • ... Kaz Kylheku
          • ... Lawrence Velázquez

Reply via email to