title: How to pass bash parameter to awk script?
body: <p>I have awk file:</p>
  
  <pre><code>#!/bin/awk -f
  BEGIN {
  
  }
  {
          filetime[$'$colnumber']++;
  }
  END {
          for (i in filetime) {
                  print filetime[i],i;
          }
  }
  </code></pre>
  
  <p>And bash script:</p>
  
  <pre><code>#!/bin/bash
  var1=$1
  awk -f myawk.awk
  </code></pre>
  
  <p>When I run:</p>
  
  <pre><code>ls -la | ./countPar.sh 5
  </code></pre>
  
  <p>I receive error:</p>
  
  <pre><code>ls -la | ./countPar.sh 5
  awk: myawk.awk:6:         filetime[$'$colnumber']++;
  awk: myawk.awk:6:                   ^ invalid char ''' in expression
  </code></pre>
  
  <p>Why? $colnumber must be replaced with 5, so awk should read 5th column of ls ouput.
  Thanks.</p>