GITLAB
gperson
/
TutoratPersonChemin
Toggle navigation
Sign in
Sign in
Project
Files
Commits
Network
Graphs
Issues
0
Merge Requests
0
Wiki
Download as
Email Patches
Plain Diff
Browse Code »
Commit
c00ec28db0de4aa20e4ebd43b31825927138a33d
Authored by
achemin1
2020-11-20 22:26:15 +0100
1 parent
72cd0d89
ajout très petit utilitaire .sh
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
hexToDec.sh
Inline
Side-by-side
hexToDec.sh
0 → 100644
Wrap text
Show/Hide comments
View file @
c00ec28
...
...
@@ -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
...
...