[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How does {x..y} supposed to work?
From: |
Reuti |
Subject: |
Re: How does {x..y} supposed to work? |
Date: |
Thu, 13 May 2021 18:54:05 +0200 |
Am 13.05.2021 um 18:32 schrieb Lawrence Velázquez:
> On Thu, May 13, 2021, at 12:02 PM, Peng Yu wrote:
>> According to the manpage, x and y can be single characters. "the
>> expression expands to each character lexicographically between x and
>> y, inclusive".
>>
>> So my understanding of the behavior of {x..y} should be that `echo
>> {%..a}` print all the ascii letters between "%" and "a" including "%"
>> and "a", but it doesn't do so. Do I interpret the manual incorrectly?
>> Or the bash implementation does not match the manpage completely?
>
> The code explicitly wants alphabetics.
The output:
bash-5.1$ echo {Z..a}
Z [ ] ^ _ ` a
seems to fall out of the "valid" range then?
-- Reuti
> 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);
>
>
> --
> vq
>
- 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, 2021/05/13
- 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 <=
Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/13
- Re: How does {x..y} supposed to work?, Mike Jonkmans, 2021/05/14
- Re: How does {x..y} supposed to work?, Greg Wooledge, 2021/05/14
- Re: How does {x..y} supposed to work?, Lawrence Velázquez, 2021/05/14
- Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/14
- Re: How does {x..y} supposed to work?, Mike Jonkmans, 2021/05/14
- Re: How does {x..y} supposed to work?, Dennis Williamson, 2021/05/14
- Re: How does {x..y} supposed to work?, Greg Wooledge, 2021/05/14
- Re: How does {x..y} supposed to work?, Dennis Williamson, 2021/05/14
Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/16