If you want to change a particular line or a range of lines
echo "//-----" | sed "L1,L2s+//---*+$parChk+g"
where L1 is the first line number of the range-of-lines you want to change. L2 is the ending line number of the range-of-lines you want to change. If you want only a particular line to be changed, then L1 and L2 will remain the same.
The below script is supposed to replace partition lines "//------" in a cpp source code. Based on the previous posts i changed the sed command accordingly. But now i am stuck up with another issue ....the sed command is found not accepting $x,$x before 's'. I gave the line number as such instead of $x and it worked.
Kindly help me in solving this problem. I want to change the multiple lines (line number given by $x from for loop) of a source file. strMatch is another script that returns a set of line numbers where the pattern is found.