LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-06-2002, 02:56 PM   #1
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Rep: Reputation: 15
Question How do I enter a subject when awk | data to mail


How do I include a subject when running the shell script:
grep "^From *" abuse.axis.old | awk '{print $2}'| mail admin@mydomain.com

I receive the amail fine but without a subject.

Thanks
 
Old 05-06-2002, 06:39 PM   #2
kill-hup
Member
 
Registered: Aug 2000
Location: NY - USA
Distribution: Slackware
Posts: 109

Rep: Reputation: 15
Unless you need a dynamic subject, "mail -s subject addr" should work fine.
 
Old 05-06-2002, 07:34 PM   #3
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Original Poster
Rep: Reputation: 15
Quick note: It did not like my subject unless it was one word.

grep "^From *" abuse.axis.old | awk '{print $2}'| mail -s abuse_email admin@mydomain.com

Worked great. Thanks.
 
Old 05-06-2002, 08:22 PM   #4
kill-hup
Member
 
Registered: Aug 2000
Location: NY - USA
Distribution: Slackware
Posts: 109

Rep: Reputation: 15
You should quote multi-word subjects:

mail -s "This is an email" user@host.com

That should do the trick.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging mail subject headers in Postfix timjames Linux - Software 1 03-20-2009 02:07 PM
Piping to mail and adding a subject line. Echo Kilo Linux - General 1 12-03-2005 11:24 AM
¿Not receiving mail?, need help isolating this -->data included latino Linux - Software 7 06-21-2005 01:06 AM
PHP - Reading data from multidimentional arrays and mail it. zyrtech Programming 8 08-09-2003 08:03 PM
How do I zip and attach the output data of a grep | awk | mail shell script? 360 Programming 1 05-08-2002 08:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:24 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