help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does {x..y} supposed to work?


From: Chet Ramey
Subject: Re: How does {x..y} supposed to work?
Date: Thu, 13 May 2021 15:28:11 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 5/13/21 12:53 PM, Greg Wooledge wrote:
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:

It's not. As long as the endpoints are numbers or letters, it's up to the
caller to manage the results.

The one possible issue (it's come up before) is whether or not this:

`

should be backslash-quoted to avoid command substitution.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]