Using sed command in shell script
<p>This is my simple shell script</p>

<p>sample.sh</p>

<pre><code>LOCALCONFIGDIR="Install"
CONFLOC="$LOCALCONFIGDIR/server.conf"
echo "Enter Web Url:"
read  weburl
echo "sed 's/^\(ServerName\)$/\1 "$weburl"/' "$CONFLOC
sed "'s/^\(ServerName\)$/\1 "$weburl"/' "$CONFLOC
</code></pre>

<p>When I run this code, I get the result in echo command as following.</p>

<pre><code>sed 's/^\(ServerName\)$/\1 www.weburl.com/' Install/server.conf
</code></pre>

<p>But when executing sed command in the next line, It says the below error.</p>

<pre><code>sed: -e expression #1, char 1: unknown command: `''
</code></pre>

<p>I tried the command produced in echo statement from Terminal screen, It is working. But <code>Line number 5</code>, doesn't working from shell script</p>