Mercurial > hg > anonet-resdb
annotate scripts/dec2hex @ 764:b7e62d7be4df draft
Merge commit '878cb53c4f76135dffe74ad1452a541ead04f9b3'
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Tue, 15 Nov 2011 19:33:12 +0000 |
parents | 31e3b4edf502 |
children | 8e01b8361e9e |
rev | line source |
---|---|
19
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
1 #!/bin/sh |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
2 ( |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 if [ x"$USE_BC" = x1 ]; then |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 echo -n "obase=16; " |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 #echo 'obase=16;if (last<16) 0; 10;' | bc |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 fi |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
7 if [ x"$1" = x ]; then |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
8 cat |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
9 else |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
10 echo "$1" |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
11 fi |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
12 ) | ( |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
13 if [ x"$USE_BC" = x1 ]; then |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
14 ( |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
15 echo -n 0 |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
16 bc -q |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
17 ) | tail -c3 |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
18 else |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
19 cat ./scripts/dec2hex.d/"$(cat)" |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
20 fi |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
21 ) |