A simple bash shell hex converter

Mar 04, '03 09:40:00AM

Contributed by: joadan

If you have a value in hex format and want to see its decimal value, you can easily convert it using the terminal. To convert 3f hexadecimal type (in a bash shell):

 $ let x=0x3f
 $ echo $x
 63

 $ let x=0xfffe
 $ echo $x
 65534
[robg adds: Not much call for hex converters in my line of work, but I thought some of you might find this useful...]

Comments (12)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2003030107340199