Getting correct linefeeds in emails generated from linux

emailformattinglog-filesscriptingsed

I have a script that emails certain linux log entries to me, and I read the email in MS Outlook.

The problem is that all the lines run together with no linefeeds between the lines.

To address this I inserted sed "s/$/\n/" before the mail command, but that gives me 2 linefeeds between each line in the email!

What is the proper way to get a single linefeed between each line (using sed)

Best Answer

Check to make sure your Outlook isn't helpfully removing line breaks for you (ie the problem isn't Linux, it's Outlook). By default I think it does. It should be telling you this at the top of the view panel.