My first time on Stack:
I'm doing a pattern match as follows. $VAR1 in this case is "/usr/lib/sendmail". The variable is read in from a separate file using a while loop.
cat /etc/rc.tcpip |grep -w "^start[[:blank:]]${VAR1}"
I want to "comment the line" (#) at the beginning of the match. I'm sure it's sed but I just can't seem to figure out how to make it work.
So existing line:
start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"
desired result:
# start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"