hexToDec.sh 200 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 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