summaryrefslogtreecommitdiff
path: root/scripts/dec2hex
diff options
context:
space:
mode:
authorNick <nick@somerandomnick.ano>2010-05-12 21:29:59 +0000
committerNick <nick@somerandomnick.ano>2010-05-12 21:29:59 +0000
commit91a8cee50c9cce580534b8cc6ca31265029ef6d2 (patch)
treefc51d8743dd321d3896e60700ae0db0fed53fd01 /scripts/dec2hex
parentd895d7d758ee8a26dac6c9ccae4f55c5624f17d1 (diff)
downloadresdb-91a8cee50c9cce580534b8cc6ca31265029ef6d2.tar.gz
resdb-91a8cee50c9cce580534b8cc6ca31265029ef6d2.zip
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Diffstat (limited to 'scripts/dec2hex')
-rwxr-xr-xscripts/dec2hex21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/dec2hex b/scripts/dec2hex
new file mode 100755
index 0000000..e997b20
--- /dev/null
+++ b/scripts/dec2hex
@@ -0,0 +1,21 @@
+#!/bin/sh
+(
+ if [ x"$USE_BC" = x1 ]; then
+ echo -n "obase=16; "
+#echo 'obase=16;if (last<16) 0; 10;' | bc
+ fi
+ if [ x"$1" = x ]; then
+ cat
+ else
+ echo "$1"
+ fi
+) | (
+ if [ x"$USE_BC" = x1 ]; then
+ (
+ echo -n 0
+ bc -q
+ ) | tail -c3
+ else
+ cat ./scripts/dec2hex.d/"$(cat)"
+ fi
+)