Mercurial > hg > anonet-resdb
comparison scripts/hex2dec @ 14:523b9c533d6c draft
rewrote hex2dec to no longer require bc
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Mon, 19 Apr 2010 08:40:20 +0000 |
parents | 059b5f3d7808 |
children | 2f57d4d36759 |
comparison
equal
deleted
inserted
replaced
13:059b5f3d7808 | 14:523b9c533d6c |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 ( | 2 ( |
3 echo -n "ibase=16; " | 3 if [ x"$USE_BC" = x1 ]; then |
4 echo -n "ibase=16; " | |
5 fi | |
4 if [ x"$1" = x ]; then | 6 if [ x"$1" = x ]; then |
5 cat | 7 cat |
6 else | 8 else |
7 echo "$1" | 9 echo "$1" |
8 fi | 10 fi |
9 ) | bc -q | 11 ) | ( |
12 if [ x"$USE_BC" = x1 ]; then | |
13 bc -q | |
14 else | |
15 cat ./scripts/hex2dec.d/"$(cat)" | |
16 fi | |
17 ) |