Wildscot
February 16th, 2011, 05:37 PM
I'm trying to comment out the following line of code in many files but I just can't get it to work.
<p style="text-align: center; margin-top: 15px; margin-bottom: 0px"><? echo getimg("allpages.php", '06', '0'); ?></p>
I've been at this so long that I can't remember everything I've tried but I don't know where I'm going wrong. I've been working on variations of the following
find ./ -type f -exec sed -i 's|<p style="text-align: center; margin-top: 15px; margin-bottom: 0px"><? echo getimg("allpages.php", '06', '0'); ?></p>|<!--&-->|g' {} \;
Both using the full string and the & sign, various seperators and successively escaping everything I can think of.
It either seems to execute and I can see the code above seems to run and I can see that it changes the time-stamp on all of the files in the path, not just those with the relevant line but nothing seems to change.
I would have been quicker to do this by hand but then I'd learn nothing!
<p style="text-align: center; margin-top: 15px; margin-bottom: 0px"><? echo getimg("allpages.php", '06', '0'); ?></p>
I've been at this so long that I can't remember everything I've tried but I don't know where I'm going wrong. I've been working on variations of the following
find ./ -type f -exec sed -i 's|<p style="text-align: center; margin-top: 15px; margin-bottom: 0px"><? echo getimg("allpages.php", '06', '0'); ?></p>|<!--&-->|g' {} \;
Both using the full string and the & sign, various seperators and successively escaping everything I can think of.
It either seems to execute and I can see the code above seems to run and I can see that it changes the time-stamp on all of the files in the path, not just those with the relevant line but nothing seems to change.
I would have been quicker to do this by hand but then I'd learn nothing!