Commit c00ec28db0de4aa20e4ebd43b31825927138a33d

Authored by achemin1
1 parent 72cd0d89

ajout très petit utilitaire .sh

Showing 1 changed file with 10 additions and 0 deletions   Show diff stats
hexToDec.sh 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +#!/bin/bash
  2 +
  3 +if [ $# -eq 1 ]; then
  4 + echo "obase=10; ibase=16; $1" | bc
  5 +else
  6 + echo "Type a hex number"
  7 + read hexNum
  8 + echo -n "The decimal value of $hexNum="
  9 + echo "obase=10; ibase=16; $hexNum" | bc
  10 +fi
... ...