Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!well!gregs From: gregs@well.sf.ca.us (Greg Strockbine) Newsgroups: comp.unix.shell Subject: awk, how to convert hex to decimal Message-ID: <23000@well.sf.ca.us> Date: 5 Feb 91 01:58:47 GMT Distribution: usa Lines: 15 How do I convert a hex number (or is it string) into decimal? Here is the problem, I take a snap shot of a hex dump from a debugger, use sed to extract the line I'm interested in, then pass it to awk. So I've got this field 930A and use the awk substr to break this into 2 fields, a=93 and b=0A. So that's 2 hex numbers represented as strings but I want to print the 93 out as a decimal number and I want to use the 0A as an index into an array of messages so I can print out a corresponding message. Can I use an associative array for the messages and say something like: usr_msg = messages[0A]? How do I convert the 93 to decimal? Thanks in advance.