title: Using different delimiters in sed commands and range addresses
body: <p>I am using sed in a shell script to edit filesystem path names. Suppose I want to replace</p>
  <pre><code>/foo/bar
  </code></pre>
  <p>with</p>
  <pre><code>/baz/qux
  </code></pre>
  <p>However, sed's <code>s///</code> command uses the forward slash <code>/</code> as the delimiter. If I do that, I see an error message emitted, like:</p>
  <pre class="lang-none prettyprint-override"><code>▶ sed 's//foo/bar//baz/qux//' FILE
  sed: 1: &quot;s//foo/bar//baz/qux//&quot;: bad flag in substitute command: 'b'
  </code></pre>
  <p>Similarly, sometimes I want to select line ranges, such as the lines between a pattern <code>foo/bar</code> and <code>baz/qux</code>. Again, I can't do this:</p>
  <pre class="lang-none prettyprint-override"><code>▶ sed '/foo/bar/,/baz/qux/d' FILE
  sed: 1: &quot;/foo/bar/,/baz/qux/d&quot;: undefined label 'ar/,/baz/qux/d'
  </code></pre>
  <p>What can I do?</p>