In 30 files in 30 directories, I want to find:
script>');} < /script>
and replace it with:
script>');} < /script-->
- What special characters do I need to escape in the find field?
- Do I need to escape the same characters in the replace_with field?
- Is backslash the appropriate escape key?
I will use the following method:
find . -type f -name "*.php" -exec sed -i 's/"find"/"replace_with"/g' {} +
That method has worked for simple replacements.
I read How can I replace a string in a file(s)?, and other pages, but could not find the answer I need.
sed "s^script>');} < /script^&--^g"
– Costas Feb 11 '16 at 22:24