15 lines
307 B
Plaintext
15 lines
307 B
Plaintext
|
le script convertis le 2eme arg en base 10
|
||
|
|
||
|
l=$(expr length $2)
|
||
|
pos=1;
|
||
|
for ((pow=l-1;pow>=0;pow--))
|
||
|
do
|
||
|
digit=$(expr substr $2 pos 1)
|
||
|
digit=(($(expr index $LEGAL_DIGITS $digit)-1))
|
||
|
if [[digit -eq 0 ]]
|
||
|
then
|
||
|
echo "Authorized digits are : $LEGAL_DIGITS"; exit
|
||
|
fi
|
||
|
decimal=((resultat+digit*&1**pow))
|
||
|
done
|