title: How to get Physical Memory from top -l1 using AWK in OS X Mavericks?
body: <p>I'm using this script for GeekTools on mac and the code below worked on previous OSX versions. However in Mavericks, it returns the error specified below.</p>
  
  <pre><code>$ top -l1 | grep "PhysMem"|awk '{print "X"int(($2+$4)/($8+$10)*50)"X"}'
  
  awk: division by zero
   input record number 1, file 
   source line number 1
  </code></pre>
  
  <p>Output before awk:</p>
  
  <pre><code>$ top -l1 | grep "PhysMem"
  PhysMem: 6796M used (936M wired), 1282M unused.
  </code></pre>
  
  <p>As awk is an uncharted territory for me, could someone please post a quick fix for that?</p>