title: sed - Commenting a line matching a specific string AND that is not already commented out
body: <p>I have the following test file</p>
  
  <pre><code>AAA
  BBB
  CCC
  </code></pre>
  
  <p>Using the following sed I can comment out the <em>BBB</em> line.</p>
  
  <pre><code># sed -e '/BBB/s/^/#/g' -i file
  </code></pre>
  
  <p>I'd like to only comment out the line if it does not already has a # at the begining.</p>
  
  <pre><code># sed -e '/^#/! /BBB/s/^/#/g' file
  
  sed: -e expression #1, char 7: unknown command: `/'
  </code></pre>
  
  <p>Any ideas how I can achieve this?</p>