Hello,
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.
srcCode=$1
parStr="//-----------------------------------------------------------------------------"
parStr="--- TESTING-BAS-BAS-TESTING ---"
linNum=`strMatch $1 "//----" | tr -d ':/-'`
for x in $linNum; do
cecho green "Replacing partition on line $x ..."
cat $1 | sed "$x,$xs+//---*+$parStr+g" > $1.tmp
done
exit