The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-02-2009
nico.ben nico.ben is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 1
SED: how to remove newline after pattern?

Hi,
I have the following XML not well-indented code:

<hallo
>this is a line
</hallo>

So I need to remove the newline.

This syntax finds what I need to correct, but I don't know how to remove the newline after my pattern:

sed 's/<.*[^>]$/&/'

How can I subtract the newline after my pattern, please?

Thank you in advance,
Nico