title: Shell - how i can use a variable in sed command
body: <p>I'm having a problem when use a variable in sed command.</p>
  
  <p>My script:</p>
  
  <pre><code>#!/bin/sh
  
  #Declaracao de variaveis
  dominio=$1
  host=$2
  
  #Configuração do Varnish
  varnish_config=$(cat &lt;&lt;-END
  if (req.http.host ~ "$dominio") {
          set req.backend_hint = $host;
          return (pass);
  }
  END
  )
  
  sed '51i\'"${varnish_config}" $PWD/teste
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>sed: -e expression #1, char 53: unknown option to `s'
  </code></pre>