[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to make an alphabetical counter
From: |
David D |
Subject: |
Re: how to make an alphabetical counter |
Date: |
Sun, 23 Dec 2001 22:54:19 +0100 |
# 1-> a ... 26->z
# from 96 lower case
# from 65 upper case
number=1
eval "echo \$'\\$(printf %o "$[$number+65]")'"
number=$number+1
eval "echo \$'\\$(printf %o "$[$number+96]")'"
# hum ...
echo uppercase("a")
Great it works !
For alphabetical in upper case, is there any fonction ,or I have to start
from 65 in hexa.
# hum .
I cas u do a simple loop, with a for statement like in c.
thanks.
> "David D" <dd@asi.fr> wrote:
> > Yes, I d like to make an alphabetical counter wich when I make ++ goes
from
> > a to b etc ...
>
> Use a numeric counter, and then to get the alphabetic character from
> the number, use:
> $ eval "echo \$'\\$(printf %o "$[$number+96]")'"
>
>
> paul