Reputation: 11
I have some html code
<div><img src="..." /></div>
and I would like to remove the img tag from it to get:
<div></div>
I wrote a bash script with the same commands I did in emacs:
cat "$1"|sed 's/</\n</g'|sed 's/>/>\n/g'|sed 's/^<img.+//g' > "$2"
but It didn't work. It seems that sed doesn't work in line breaks. Any suggestions?
I also tried:
sed 's/<img.+>//g'
but this removes too much code.
Thanks in advance.
Upvotes: 0
Views: 268