Created
May 18, 2012 18:21
-
-
Save sitkevij/6b76c92fdb9e4a355f3c to your computer and use it in GitHub Desktop.
bash script to convert a string from hex to decimal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HEX=c9fc17d693b58ad31448d1177728964591ad1c720b545a05c700395c980a7029 | |
i=1 | |
while (( i <= ${#HEX} )) | |
do | |
char=$(expr substr "$HEX" $i 2) | |
# echo "<$char>" | |
printf "%d\n" 0x$char | |
(( i += 2 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment