LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-27-2008, 04:44 AM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 517

Rep: Reputation: 39
Question Pipe'ing the ouput of 'cat' into 'mutt' (email) losses newlines when email received


Hi All,
Ok a little strange wording of the tittle there

Basically the strange problem i have is that on the local server i have a file and if i 'cat /file' then i can view the file as expected and the sentences throughout the file so to speak are each on a newline as they should be. When doing something like:-
cat /file | mutt -s 'blah' email@blah.com

and i receive the message in my inbox..the email has lost the newlines and the file is one long sentence all into one line with no line breaks. I don't know why that is and i want the email to show the output exactly how the 'cat' of the file shows the output when i'm on the server locally.

eg:-
on local system cat output would be:
abc
bdc
abc21
blah
foo bar
yey

same file 'cat' to an email and viewing the email would show:
abc bdc abc21 blah foo bar yey

Cheers all

Last edited by helptonewbie; 08-27-2008 at 07:22 AM.
 
Old 08-28-2008, 02:57 AM   #2
kenoshi
Member
 
Registered: Sep 2007
Location: SF Bay Area, CA
Distribution: CentOS, SLES 10+, RHEL 3+, Debian Sarge
Posts: 159

Rep: Reputation: 32
What mail server are you using? I tried and didn't see any problems, maybe some of the email gurus can comment on this.

BTW not to nickpick, but you can just:
Code:
mutt -s 'blah' email@blah.com < file
Hope this helps.
 
Old 08-28-2008, 03:16 AM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 517

Original Poster
Rep: Reputation: 39
Ahh wicked, thanks kenoshi....that actually made all the difference...must be something to do with what the cat and the pipe perhaps loosing newline tags or something..O well not to worry as it works now with re-directing into mutt with the input director


Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
email received with =20 at end cambie Linux - Server 3 01-03-2008 12:40 PM
Archiving both received and sent email? neocookie Linux - Server 3 09-26-2007 09:13 AM
0 replies email not received today ... minrich LQ Suggestions & Feedback 11 12-04-2005 11:29 PM
Using mutt for two different email accounts spydrmn Linux - General 2 03-08-2005 07:16 AM
run script when email is received Syncrm Linux - General 10 04-20-2003 04:57 PM


All times are GMT -5. The time now is 05:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration