bug-bash
[Top][All Lists]
Advanced

[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 23:38:18 +0100

In fact I d like to make a bash script that create a dir for each of
alphabetcal char something like :

# 1-> a ... 26->z

# from 97 lower case -> 122

# from 65 upper case -> 90

#number=1

#eval "echo \$'\\$(printf %o "$[$number+65]")'"

#number=$number+1

#eval "echo \$'\\$(printf %o "$[$number+96]")'"

# créer les 26 rep avec les lettres de l'alphabet

number=97

while [ $number -le 122 ]

do

eval "mkdir \$'\\$(printf %o "$[$number]")'"

number=$number+1

done



but there is an error during the execution in the line :

number=$number+1

integer expression expected, how can i do to correct this.



mc.





> "David D" <address@hidden> 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





reply via email to

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