#!/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