From c00ec28db0de4aa20e4ebd43b31825927138a33d Mon Sep 17 00:00:00 2001 From: Axel CHEMIN Date: Fri, 20 Nov 2020 22:26:15 +0100 Subject: [PATCH] ajout très petit utilitaire .sh --- hexToDec.sh | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) create mode 100644 hexToDec.sh 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