<p>
This is obvious, but it tripped me up a few times after listening to the excellent Awk series by Dave and B-yeezi, so I though I'd share it here to save others the trouble.
</p>

<p>
When moving from simple awk commands to proper awk scripts, you put a shebang line at the top of your script. It's pretty common to many of us, because we do it for Python and Bash all the time.
</p>

<p>
But if you just put:
</p>

<pre>
#!/usr/bin/awk
</pre>
<p>
Then your awk script won't work the way you expect.</p>

<p>
You must provide the <code>-f</code> flag:
</p>
<pre>
#!/usr/bin/awk -f
</pre>

<p>
Now you can pipe things to your awk script as expected. 
</p>


