LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] sed

[ILUG] sed

Baruch Even baruch at ev-en.org
Sun Jul 11 13:52:18 IST 2004


* olearypj at rte.ie <olearypj at rte.ie> [040711 14:14]:
> Hi Timothy, 
>              Thanks for the reply, this is a bit of the output form "od -c email"
> where I thought the blank lines were, or at least thats what it looks when I
> look at the email as a text file.
> 
> 0003560   :       r   o   o   t   @   a   u   s   -   c   i   t   y   .
> 0003600   c   o   m  \r  \n  \r  \n  \r  \n   O   S   C   A   R       7
> 0003620  \r  \n   1       0   7   5   3   0   U       7   4   0   8   9
> 
> The \r \n characters between city.com & oscar 7 is where I thought the blank
> lines  were

For some reason your mail has dos end of lines (\r\n) instead of unix
eol (\r).

sed is confused for that, try a file with the content:
---
aaa

bbb
---

Once load it in vim, set ff=unix, write it and run your sed script,
and again set ff=dos, write and test with sed. The ff=dos case fails.

The problem is that the line is not empty as far as sed is concerned, it
has a \n character in it.

You can try the command: sed -e '1,/^[[:space:]]\?$/d'
to try to handle lines with a single space in them (\n is a space).

I couldn't find how to specify \n by itself.

Baruch



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell