LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-03-2005, 12:54 AM   #1
Echo Kilo
Member
 
Registered: Jul 2004
Distribution: Ubuntu - Debian Based
Posts: 242

Rep: Reputation: 30
Piping to mail and adding a subject line.


When I run a command or script and pipe it to mail, how do I add a subject line to the mail?

For example:

rsync -av /home/ /b/home | mail email@gmail.com

This will send the output, but without a subject line. Also, what if want to add some text in the body before the contents that are piped?
 
Old 12-03-2005, 11:24 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
How about putting the message in a text file or maybe using the here doc would work....

mail -s "howdy" me@mydomain.com < message.txt

or

mail -s "howdy" me@mydomain.com << EOF
> this is a test
> EOF
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SpamAssassin won't rewrite Subject line mindfrost82 Linux - Software 2 09-18-2005 10:16 AM
c++ not qualified to give good subject line. exodist Programming 5 06-07-2005 02:59 AM
Spamassasin, Tagging Subject line lapthorn Linux - Networking 1 09-30-2004 04:19 PM
piping mail into a program ejy2 Linux - Networking 5 06-23-2004 10:35 PM
suggestions for subject line when posting. abrakadabra LQ Suggestions & Feedback 14 05-16-2002 09:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration