I have a block of php code (inside <? php ... ?>) in multiple files which I want to remove.
I tried to put the code into a variable:
var="<?php [some code in here] ?>"
Then run this:
find . -type f -name '*.php' -exec sed "s|$var| |" {} \;
Or
find . -type f -name '*.php' -exec sed -i 's/'"$var"'.*/'"$str"'/g' {} \;
(where str=" ")
Is there a way to do this?
$,!,",')?/or.or[or*or something else that breaks yoursedscript. We could better help you if you tell us the actual code to be removed.