title: awk script header: #!/bin/bash or #!/bin/awk -f?
body: <p>In an awk file, e.g example.awk, should the header be <code>#!/bin/bash</code> or <code>#!/bin/awk -f</code>? </p>
  
  <p>The reason for my question is that if I try this command in the console I receive the correct file.txt with "line of text":</p>
  
  <pre><code> awk 'BEGIN {print "line of text"}' &gt;&gt; file.txt
  </code></pre>
  
  <p>but if i try execute the following file with ./example.awk:</p>
  
  <pre><code>#! /bin/awk -f
  awk 'BEGIN {print "line of text"}' &gt;&gt; file.txt
  </code></pre>
  
  <p>it returns an error:</p>
  
  <pre><code>$ ./awk-usage.awk
  awk: ./awk-usage.awk:3: awk 'BEGIN {print "line of text"}' &gt;&gt; file.txt
  awk: ./awk-usage.awk:3:     ^ invalid char ''' in expression
  </code></pre>
  
  <p>If I change the header to <code>#!/bin/bash</code> or  <code>#!/bin/sh</code> it works.</p>
  
  <p>What is my error? What is the reason of that?</p>