I have many files with lines that begin with main followed by a left curly brace and end with a line containing a right curly brace. I want to remove these lines:
main {
top:190px;
margin-left:auto;
margin-right:auto;
width:70%
}
I've tried commands like this where I escape the curly braces:
find . -name "*.html" -exec sed -i '/^main.*\{/,/^\}/d' {} +
and gotten error messages like this:
sed: -e expression #1, char 11: Invalid preceding regular expression
When I don't escape the curly braces, I don't get an error message but it doesn't remove the lines.
I'm using GNU sed version 4.7 on a system running GNU bash version 5.0.3(1)-release (x86_64-pc-linux-gnu)