I've been trying all sorts of variations in this sed command in order to insert a linebreak in a replacement string, and also to match a multiple line string that I wish to replace. But when I try, it either has no effect or creates an ^M
when using \n
or \r
.
I'm using GNU sed with zsh:
find ./ -type f -exec sed -i "s/<?php echo \$var_one;?>/<?php echo \$var_one;?>\n\n/g" {} \;
find ./ -type f -exec sed -i 's/<?php echo \$var_one;?>/<?php echo \$var_one;?>\n\n/g' {} \;
Is there no way to do this with sed, or am I doing something wrong?