1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/sh ( if [ x"$USE_BC" = x1 ]; then echo -n "ibase=16; " fi if [ x"$1" = x ]; then cat else echo "$1" fi ) | ( if [ x"$USE_BC" = x1 ]; then bc -q else cat `dirname "$0"`/hex2dec.d/"$(cat)" fi )