title: Escaping question mark character in sed bash script variable
body: <p>I have a set of saved html files with links in them of the form <a href="http://mywebsite.com/showfile.cgi?key=somenumber" rel="noreferrer">http://mywebsite.com/showfile.cgi?key=somenumber</a> but I want to kill the question mark (side-story is that firefox hates ? and randomly converts it to %3F I'm sure there's some magic fix but that's for another question...)</p>
  
  <p>However, I think my code is causing the question-mark character to not be read/saved/handled properly when storing the options as a variable by bash</p>
  
  <pre><code># Doesn't work (no pattern matched)
  SED_OPTIONS='-i s/\.cgi\?key/\.cgikey/g'
  
  # Works e.g. http://mywebsite.com/showfileblah?key=somenumber
  SED_OPTIONS='-i s/\.cgi/blah/g'
  
  # Leaves question mark in e.g. http://mywebsite.com/showfile.blah?key=somenumber
  SED_OPTIONS='-i s/cgi\?/blah/g'
  
  # Actual sed command run when using SED_OPTIONS (I define FILES earlier in
  # the code)
  sed $SED_OPTIONS $FILES
  
  # Not using the SED_OPTIONS variable works
  # e.g. http://mywebsite.com/showfile.cgikey=somenumber
  sed -i s/\.cgi\?key/\.cgikey/g $FILES
  </code></pre>
  
  <p>How can I get the full command to work using the SED_OPTIONS variable?</p>