The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mail issue - Subject title missing kiem SUN Solaris 2 10-10-2007 03:56 PM
what are the codes used for setting the subject in the mail command? Jason3107 UNIX for Dummies Questions & Answers 2 07-12-2007 10:15 AM
sort mail based on subject in unix. sriram.s Shell Programming and Scripting 2 02-02-2007 07:38 AM
How to set Subject in 'mail' ? hkapil UNIX for Dummies Questions & Answers 2 10-14-2005 05:36 PM
Send a mail with a subject and an attachement josecollantes UNIX for Dummies Questions & Answers 1 08-28-2001 12:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-29-2001
kiano kiano is offline
Registered User
  
 

Join Date: Nov 2001
Location: Hull - UK
Posts: 5
Mail subject output of script

I am new to this site so please bear with my ignorances.

I have started playing with mail on AIX 4.3.3 with many successes (thanks to this site) but am now stuck.

I want to send a mail with the subject as the result of a script, eg. I want the mail body to read as the output from 'df -k /......' - this is sheer laziness but it would save my collegeues reading the mail when the results are in the subject header - hope this makes sense.

I have tried calling variables in the mail -s ".....${}" without success.

Regards

Kiano
  #2 (permalink)  
Old 11-29-2001
ghoti's Avatar
ghoti ghoti is offline
Registered User
  
 

Join Date: Jul 2001
Location: Wales
Posts: 55
I don't know if this is of any help, but I had the same problem with getting 'mail' to run from within a script, and I had to resort to using sendmail.

below is an example of how I used it.
Code:
#!/bin/bash
TO="me@xxx.com"
CC=""
FROM="someone_else@xxx.com"
SUBJECT="This is a test"

/usr/sbin/sendmail -t <<-EOF
To: $TO
Subject: $SUBJECT
        Hello,
        Body goes here. 
        regards,
        your script

EOF
echo "Done....!="
I hope this helps a bit..
-gHoTi
  #3 (permalink)  
Old 11-29-2001
kiano kiano is offline
Registered User
  
 

Join Date: Nov 2001
Location: Hull - UK
Posts: 5
Thanks ghoti

It think i relayed my request incorrectly.

I need the subject to be the output of a script,

mail -s "output from my script"

Thanks in advance

Kiano
  #4 (permalink)  
Old 11-29-2001
ghoti's Avatar
ghoti ghoti is offline
Registered User
  
 

Join Date: Jul 2001
Location: Wales
Posts: 55
I know what you said, and I think you can do it using this.

Simply assign the output of your script to the variable SUBJECT / $SUBJECT in the above example and away you go....

I only put all the rest in there as it was the way I used it and shows most of the settings, which could be helpful fo rother solutions as well....
  #5 (permalink)  
Old 11-29-2001
kiano kiano is offline
Registered User
  
 

Join Date: Nov 2001
Location: Hull - UK
Posts: 5
You're right!

Thanks very much for your help


Kiano
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0