I am using sed inside a makefile with the extended regex to replace the text between defined lines with the variable Initial
and Final
like this -
sed -i -r -e "/$$Initial/,/$$Final/s/$$orig/$$new/g" $$file; \
The above works, but it has lots of forward slash
in the values of the variable which works by double escaping those. It would look cleaner if I could replace the delimiter with some other symbols like as follows:
sed -i -r -e "\!$$Initial!,!$$Final!s!$$orig!$$new!g" $$file ; \
But this is showing error with ,
in the sed expression. Could you please suggest changes?