[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How does {x..y} supposed to work?
From: |
Lawrence Velázquez |
Subject: |
Re: How does {x..y} supposed to work? |
Date: |
Thu, 13 May 2021 12:32:07 -0400 |
User-agent: |
Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 |
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 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 <=
- 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, 2021/05/13
Re: How does {x..y} supposed to work?, Chet Ramey, 2021/05/13