title: How to pass an argument with spaces to sed command?
body: <p>I have the below function in my shell script</p>
  
  <pre><code>fnChangeTxt()
  {
          sed -i 's/&lt;div id="'$1'"&gt;&lt;p&gt;*.*&lt;/&lt;div id="'$1'"&gt;&lt;p&gt;'$2'&lt;/' /var/www/html/alarm.html
  }
  </code></pre>
  
  <p>I would like use the below the pass a string to the sed command via $2 argument.</p>
  
  <pre><code>fnChangeTxt 'demo' 'This text to sed'
  </code></pre>
  
  <p>Hoever this doesn't work and produces and error, I assume it is due to the white spaces as the below command works fine.</p>
  
  <pre><code>fnChangeTxt 'demo' 'This_text_to_sed'
  </code></pre>
  
  <p>Is there a way to do this with spaces?</p>
  
  <p>Thanks in advance.</p>