Subject line missing while sending mail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Subject line missing while sending mail
# 1  
Old 06-13-2012
Subject line missing while sending mail

Hi,

I have below script

Code:
PROJECT_NAME=UDL/UDL_Weekly
sub= echo ${PROJECT_NAME}|cut -d "/" -f2
cat pr.sh|mail -s "`hostname`: $sub failed" sonu.pal@xyz.com

While running the script I am receiving the subject line in mail as " podetlsapp01: failed' instead of " podetlsapp01: UDL_Weekly failed "

Can anybody help me on that..

Last edited by pludi; 06-13-2012 at 11:16 AM..
# 2  
Old 06-13-2012
Code:
$ sub=`echo ${PROJECT_NAME}|cut -d "/" -f2`

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies

2. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies

3. UNIX for Dummies Questions & Answers

How to grep a string and add to subject line of a mail?

I am running a mailx command as follows in Linux: mailx -s "Elapsed Time: " ora_dbas < $RUNDIR/sql_timings.out I am trying to parse the file "sla_local_sql_timings.out" for the word Elapsed Time: and get the time from that file stored in a variable and display that variable in the subject... (4 Replies)
Discussion started by: vrkcamry
4 Replies

4. Shell Programming and Scripting

Grep the last line and put on mail subject

I have mail: cat /home/oracle/scripts/dbsizedaily.txt | mail -s "$TODAY: PROD DB Size" $RECIPIENTS I like to get and put USED_GB and %USED of the very last row from /home/oracle/scripts/dbsizedaily.txt. /home/oracle/scripts/dbsizedaily.txt has : DATE TIME TOTAL_GB USED_GB ... (6 Replies)
Discussion started by: Daniel Gate
6 Replies

5. Shell Programming and Scripting

Stop sending mail after certain number of mail

Hi guys... I am busy writing a script to notify me via an mail if my application is down. I have done that. Now I want this script to stop sending mails after five mails were sent but the script should keep on checking the application. When the application is up again that count should be... (5 Replies)
Discussion started by: Phuti
5 Replies

6. Shell Programming and Scripting

Sending mail

Hi there, How can I send the automated log file, daily at 7 am to the respective mail . Thanks in Advance, Neha (2 Replies)
Discussion started by: NehaKrish
2 Replies

7. UNIX for Dummies Questions & Answers

Sending a simple mail from command line

Hi, How would one send an email from the command line. Just a simple email. I used mailx -s "test" address@server.domain then hit enter. Nothing happens then, I hit Ctrl + C twice, then I can start a new command again. Any help? Tips? I did read up on this, but the examples is much more... (2 Replies)
Discussion started by: McGuywer
2 Replies

8. Ubuntu

help sending mail

Hi, I have kubuntu 8.10 and I would like to configure Ubuntu to can send mail from command line with mailx. I've saw that I need to install a MTA. But I don't know with install and how. Do you know some howto or url where I find how could I configure it? Many thanks and sorry for my... (2 Replies)
Discussion started by: mierdatuti
2 Replies

9. Solaris

Mail issue - Subject title missing

I am not getting the Subject Title when sending mail from a Solaris server to the Outlook recipient. Example: #mail -s "Testing Subject title" xxx@mymail.com Test . # Here's what it shows in Microsoft Outlook (lil bit altered, but similar to it) -----Original Message-----... (2 Replies)
Discussion started by: kiem
2 Replies

10. UNIX for Dummies Questions & Answers

sending a mail to a mail client

Hi everyone! I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string. Is there a way to send this message to a mail client using SMTP? Even better, is there any place on this site that has these kinds of... (5 Replies)
Discussion started by: solaris73
5 Replies
Login or Register to Ask a Question