I am trying to update this html:
<svg xmlns="http://www.w3.org/2000/svg" width="20" viewBox="0 0 256 256">
with this html:
<svg xmlns="http://www.w3.org/2000/svg" width="30" viewBox="0 0 256 256">
in about about 25 html files in a file structure like this /html/custom-folder-name-one.html /html/custom-folder-name-two.html /html/custom-folder-name-three.html.
I am wanting to change the width="20" to width="30" in that particular SVG string of the html but cannot simply isolate down to the width attribute because of other instances in the html that are using the same width attribute value.
This command works perfectly in my environment for small and basic html changes. find . -name "*.html" -exec sed -i 's/14px/18px/g' {} ;
But when they become more complex like this:
find . -name "*.html" -exec sed -i 's/<svg xmlns="http://www.w3.org/2000/svg" width="20" viewBox="0 0 256 256">/<svg xmlns="http://www.w3.org/2000/svg" width="30" viewBox="0 0 256 256">/g' {} \;
I get the following error from terminal:
sed: couldn't open file ww.w3.org/2000/svg" width="20" viewBox="0 0 256 256">//: No such file or directory
I tried converting the html string that I am wanting to find/replace into regex like this: ^$
But then I read that regex can't parse html due to its recursive structure and I also took the liberty of shaving my eyebrows after reading this post RegEx match open tags except XHTML self-contained tags.
Any help would be greatly appreciated.