#!/bin/sh end=19 start=10 tmp=$(( (10#$end - 10#$start) )) echo $tmp
#!/bin/sh end=ff start=80 tmp=$(( (16#$end - 16#$start) )) echo $tmp