This is my simple shell script
sample.sh
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
When I run this code, I get the result in echo command as following.
sed 's/^\(ServerName\)$/\1 www.weburl.com/' Install/server.conf
But when executing sed command in the next line, It says the below error.
sed: -e expression #1, char 1: unknown command: `''
I tried the command produced in echo statement from Terminal screen, It is working. But Line number 5, doesn't working from shell script