title: How to use sed in a Makefile
body: <p>I have tried putting the following in my Makefile:</p>
  
  <pre><code>@if [ $(DEMO) -eq 0 ]; then \
      cat sys.conf | sed -e "s#^public_demo[\s=].*$#public_demo=0#" &gt;sys.conf.temp; \
  else \
      cat sys.conf | sed -e "s#^public_demo[\s=].*$#public_demo=1#" &gt;sys.conf.temp; \
  fi
  </code></pre>
  
  <p>but when I run <em>make</em>, I get the following error:</p>
  
  <pre><code>sed: -e expression #1, char 30: unterminated `s' command
  </code></pre>
  
  <p>If I run the exact lines that contain <code>sed</code> in the console, they behave correctly.</p>
  
  <p>Why am I getting this error and how can the problem be fixed?</p>