Decode %s Special Character in Sed

Greetings,

I am doing something that I don't know if it is possible...
I have a file with a line looks like this:
<%s \n%s / %s \n%s \n>
and I am trying to replace this line with
<%s \n%s \n%s / %s \n%s \n>
in Shell script with sed command...

StringToReplace='%s \n%s / %s \n%s \n'
StringReplace='%s \n%s \n%s / %s \n%s \n'
cat $filename | sed "$lineNum"s/$StringToReplace/$StringReplace/g > $TempFile

Is it even possible to decode the character '%' as string?

Thanks in advance!

Howdi

[~]$ cat buf
%s \n%s / %s \n%s \n changed
[~]$ sed  's|%s \\n%s / %s \\n%s \\n|%s \\n%s \\n%s / %s \\n%s \\n|' buf 
%s \n%s \n%s / %s \n%s \n changed

Thx so much agn! It worked super well!! :slight_smile: