title: integer variable in awk script
body: <p>I have the following code in a shell script: to count the number of columns first (variable numCol), then plug it in the for-loop in the awk to check if all the values are all 0s in each line:</p>
  
  <pre><code>numCol=$(awk '{print NF}' $line | head -n 1)$
  awk '{for (i=1; i&lt;=$numCol; ++i) if($i != 0) {print;next}}' $line$
  </code></pre>
  
  <p>but, I got this error: <code>awk: illegal field $(), name "numCol"</code></p>