Replace multiple lines in a file with single line with variable containing escape characters
<p>New to Shell Script. 
I have file. Sample like</p>

<p><strong>sample.txt</strong></p>

<pre><code>some text1
txt2
element : /home/user/somelocation text1
loc : /home/user/somelocation text2
</code></pre>

<p>I'm trying to write shell script to replace lines containing <code>/home/user/</code>with <code>element : /home/testuser/somelocation text</code></p>

<p>Both search text and replace test are variable to get from user.</p>

<pre><code>#!/bin/csh

# Sample searchStr="/home/user/"
set searchStr=$1 

# Sample rplcStr="element : /home/testuser/somelocation text"
set rplcStr=$2
sed -i '/$searchStr/c\$rplcStr' sample.txt
</code></pre>

<p>But this isn't working.</p>

<p>Expected Output</p>

<pre><code>some text1
txt2
element : /home/testuser/somelocation text
</code></pre>

<p>How to replace it?</p>