title: awk version issue - convert hex to decimal
body: <p>I usually write scripts on my mac and then once it is ready, I sftp them to my test box at work. The issue I am facing here is that I have a stream of data that is an I.P address in hex format. I am using mix of sed and awk to parse it and convert it into a more readable format. </p>
  
  <pre><code>$echo $content12
  cb5c860100000000000000000000000000 
  
  [DoD@MBP-13~] echo $content12 | 
  sed -e 's/../&amp;./g' -e 's/.$//' | sed 's/[0-9a-z][0-9a-z]/0x&amp;/g' | 
  awk -F"." '{for (i=1;i&lt;NF;i++) printf ("%d\n", $i)}' |
  awk '{if (NR&lt;5) printf $0; printf "."}' | sed 's/\.\.*$//'
  203.92.134.1 
  </code></pre>
  
  <p>When I ported this to my test box at work, the script did not work as expected. </p>
  
  <pre><code>$echo $content12 | 
  sed -e 's/../&amp;./g' -e 's/.$//' | sed 's/[0-9a-z][0-9a-z]/0x&amp;/g' | 
  awk -F"." '{for (i=1;i&lt;NF;i++) printf ("%d\n", $i)}' | 
  awk '{if (NR&lt;5) printf $0; printf "."}' | sed 's/\.\.*$//'
  0.0.0.0
  </code></pre>
  
  <p><strong>Version of awk and uname on my mac -</strong></p>
  
  <pre><code>[DoD@MBP-13~] awk --version
  awk version 20070501
  
  [DoD@MBP-13~] uname -a
  Darwin MBP-13.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011;     
  root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
  </code></pre>
  
  <p><strong>Version of awk and uname on my test box at work -</strong> </p>
  
  <pre><code>$ awk --version
  GNU Awk 3.1.5
  Copyright (C) 1989, 1991-2005 Free Software Foundation
  
  $uname -a
  Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 
  x86_64 x86_64 x86_64 GNU/Linux
  </code></pre>
  
  <p>Is this something I can fix with minor changes. I am still very new to UNIX environment so my one-liner may seem abnormally long to you. Any suggestions would be greatly appreciated.     </p>