[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How does {x..y} supposed to work?
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: How does {x..y} supposed to work? |
Date: |
Fri, 14 May 2021 00:06:30 +0200 |
btw now better addressed
you chet said {..} expands early, like before $var can be resolved
but wouldnt you wanna add {$'\100'..$'\105'} .. those are static
i thought somehow it did work but for me it didnt now
On Fri, May 14, 2021 at 12:01 AM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> wrote:
>
> printf -v b %d \'%
>
> printf -v e %d \'e
>
> printf "$( eval "printf ' \\\\%s' {$b..$e}" )"
> 8 9 ! " # $ % & ' 8 9 ( ) * + , - . / 8 9 0 1 2 3 4 5 6 7 8 9 8 9
> : ; < = > ? 8 9 \80 \81 \82 \83 \84 \85 \86 \87 \88 \89 \90 \91 \92
> \93 \94 \95 \96 \97 \98 \99 @ A^[[?1;2c^[[?1;2c
>
> a bit big time invalid but maybe helps
>
> On Thu, May 13, 2021 at 9:28 PM Chet Ramey <chet.ramey@case.edu> wrote:
> >
> > 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/
> >
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