title: awk - Skip Header, Add Columns
body: <p>I need to create a script that uses awk to sum the values of several columns that are output by a LSF command. I also need the script to skip the headers in the first line. This is what I have so far, will it work? I'm not sure that it will properly skip the first line and add the others. I would test it, but I do not have access to the LSF machines.</p>
  
  <pre><code>bhosts | awk '
      BEGIN { running=suspended=reserved=0; }
      NR &lt; 2 { next }
      (running = running + $6)
      (a = a + $7)
      (b = b + $8)
      (suspended = a + b)
      (reserved = reserved + $9)
      END {
             ...
             ...
           }'
  exit
  </code></pre>