delete matching in multiple lines sed

Soren Orel soren.orel at gmail.com
Sat Jul 25 20:21:45 UTC 2009


whops, wrong example, this one's the good:
echo -e "something\n</tr>\n<tr>\n</tr>\nsomething" | sed
"s/<\/tr>\n<tr>\n<\/tr>/<\/tr>/g"
And this is not working :D
$ echo -e "something\n</tr>\n<tr>\n</tr>\nsomething" | sed
"s/<\/tr>\n<tr>\n<\/tr>/<\/tr>/g"
something
</tr>
<tr>
</tr>
something


I just want to swap the:
</tr>
<tr>
</tr>
to this:
</tr>
On Sat, Jul 25, 2009 at 10:08 PM, Soren Orel <soren.orel at gmail.com> wrote:

> $ echo -e "something\n<tr>\n<\\\tr>\nsomething" | sed "/<tr>\n<\tr>/d"
> something
> <tr>
> <\tr>
> something
> Why isn't sed deleting the two lines with the "tr" ?:P
> ...I google....
> If anyone knows the solution...thanks.... :D
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090725/546429ad/attachment.html>


More information about the ubuntu-users mailing list