![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mail issue - Subject title missing | kiem | SUN Solaris | 2 | 10-10-2007 11:56 AM |
| what are the codes used for setting the subject in the mail command? | Jason3107 | UNIX for Dummies Questions & Answers | 2 | 07-12-2007 06:15 AM |
| sort mail based on subject in unix. | sriram.s | Shell Programming and Scripting | 2 | 02-02-2007 04:38 AM |
| How to set Subject in 'mail' ? | hkapil | UNIX for Dummies Questions & Answers | 2 | 10-14-2005 01:36 PM |
| Send a mail with a subject and an attachement | josecollantes | UNIX for Dummies Questions & Answers | 1 | 08-27-2001 08:55 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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....!="
-gHoTi
__________________
regards, -ghoti |
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
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....
__________________
regards, -ghoti |
|
#5
|
|||
|
|||
|
You're right!
Thanks very much for your help Kiano |
|||
| Google The UNIX and Linux Forums |