Syntax error on awk call with if statement, works without
<p>I've got a simple awk line in a makefile that prints out every line of a file.</p>

<pre><code>awk '{print $0}' ../foo/foo.h &gt;&gt; bar.c
</code></pre>

<p>It works fine when I run make. But there is some lines in foo.h that I don't want carried over to bar.c. So I modified the awk.</p>

<pre><code>awk '{if ($0 != "#include \"foobar.h\"") {print $0}}' ../foo/foo.h &gt;&gt; bar.c
</code></pre>

<p>But I get a syntax error back.</p>

<pre><code>awk '{if ( != "#include \"foobar.h\"") {print }}' ../foo/foo.h &gt;&gt; bar.c
awk: {if ( != "#include \"foobar.h\"") {print }}
awk:       ^ syntax error
</code></pre>

<p>I'm guessing its a simple mistake on my part, but I can't quite figure it out.</p>