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: 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.



reply via email to

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