diff options
Diffstat (limited to 'scripts/dec2hex')
-rwxr-xr-x | scripts/dec2hex | 21 |
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 +) |