title: How can I escape forward slashes in a user input variable in bash?
body: <p>I'm working on a script to make setting up a Statamic site more efficient. The problem I'm running into is that the variable I'm using to replace a string in a file has unescaped forward slashes and is user input. How can I make sure that <code>_site_url: http://statamic.com</code> will become <code>_site_url: http://example.com</code>?</p>
  
  <p>The code below will work as long as there are no forward slashes present.</p>
  
  <pre><code>echo "What's your site URL? Don't forget the protocol (ex. http://)!"
  read -e SITE_URL
  
  echo "%s/_site_url: http:\/\/statamic.com/_site_url: $SITE_URL/g
  w
  q
  " | ex _config/settings.yaml
  </code></pre>