diff --git a/hexToDec.sh b/hexToDec.sh new file mode 100644 index 0000000..a01673d --- /dev/null +++ b/hexToDec.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ $# -eq 1 ]; then + echo "obase=10; ibase=16; $1" | bc +else + echo "Type a hex number" + read hexNum + echo -n "The decimal value of $hexNum=" + echo "obase=10; ibase=16; $hexNum" | bc +fi -- libgit2 0.21.2