title: Cygwin bash: unexpected EOF while looking for matching `"'
body: <p>I have got a .rules file with the following command:</p>
  
  <pre><code>echo "char _$(var1)_b_[] = \"@(#) $(var1) $(var2) $(var3)\";" &gt; $@
  </code></pre>
  
  <p>Processing this file by cygwin bash I've got the following error:</p>
  
  <pre><code>echo "char _a_b_[] = \"@(#) abc 1.2.3 [03/05/2014 064 01:10]\";" &gt; file.c
  
  _a_b_[]: -c: line 1: unexpected EOF while looking for matching `"'
  
  _a_b_[]: -c: line 2: syntax error: unexpected end of file
  </code></pre>
  
  <p>On Linux it works fine. 
  I tried to replace double quotes with a single ones:</p>
  
  <pre><code>echo 'char _$(var1)_b_[] = "@(#) $(var1) $(var2) $(var3)";' &gt; $@
  </code></pre>
  
  <p>But it doesn't help for me. What's wrong with this command?</p>
  
  <p><strong>UPD</strong></p>
  
  <p>I found out the error is raised due to space character. The command</p>
  
  <pre><code>echo 'char _$(var1)_b_[] = "@(#) $(var1)";' &gt; $@
  </code></pre>
  
  <p>failes, but this one</p>
  
  <pre><code>echo 'char _$(var1)_b_[] = "@(#)$(var1)";' &gt; $@
  </code></pre>
  
  <p>is OK. Looks like bash thinks $(var1) is a new command and can't find needed quote:</p>
  
  <pre><code>echo " " &gt; file.c
  \ &gt; file.c: -c: line 1: unexpected EOF while looking for matching `"'
  \ &gt; file.c: -c: line 2: syntax error: unexpected end of file
  </code></pre>