[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How does {x..y} supposed to work?
From: |
Greg Wooledge |
Subject: |
Re: How does {x..y} supposed to work? |
Date: |
Thu, 13 May 2021 12:53:30 -0400 |
On Thu, May 13, 2021 at 12:32:07PM -0400, Lawrence Velázquez wrote:
> The code explicitly wants alphabetics. The manual could probably
> stand to be a little more specific than just "characters".
>
> https://git.savannah.gnu.org/cgit/bash.git/tree/braces.c?id=ce23728#n497
>
> /* Now figure out whether LHS and RHS are integers or letters. Both
> sides have to match. */
> lhs_t = (legal_number (lhs, &tl)) ? ST_INT :
> ((ISALPHA (lhs[0]) && lhs[1] == 0) ? ST_CHAR : ST_BAD);
>
One wonders whether this is a bug:
unicorn:~$ echo {Z..a}
Z [ ] ^ _ ` a
It checks the first and last, makes sure they're alpha characters, but
doesn't check anything in the middle.
- How does {x..y} supposed to work?, Peng Yu, 2021/05/13
- Re: How does {x..y} supposed to work?, Lawrence Velázquez, 2021/05/13
- Re: How does {x..y} supposed to work?,
Greg Wooledge <=
- Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/13
- Re: How does {x..y} supposed to work?, Alex fxmbsw7 Ratchev, 2021/05/13
- Re: How does {x..y} supposed to work?, Alex fxmbsw7 Ratchev, 2021/05/13
- Re: How does {x..y} supposed to work?, Greg Wooledge, 2021/05/13
- Re: How does {x..y} supposed to work?, Alex fxmbsw7 Ratchev, 2021/05/13
- Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/14
Re: How does {x..y} supposed to work?, Reuti, 2021/05/13
Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/13