Recursive multiline sed - remove beginning of file until pattern match.

Posted by yaya3 on Stack Overflow See other posts from Stack Overflow or by yaya3
Published on 2010-06-08T15:43:40Z Indexed on 2010/06/08 15:52 UTC
Read the original article Hit count: 269

Filed under:
|
|

I have nested subdirectories containing html files. For each of these html files I want to delete from the top of the file until the pattern <div id="left- This is my attempt from osx's terminal:

find . -name "*.html" -exec sed "s/.*?<div id=\"left-col/<div id=\"left-col/g" '{}' \;

I get a lot of html output in the termainal, but no files contain the substitution or are written

Thanks

© Stack Overflow or respective owner

Related posts about sed

Related posts about multiline