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
hp ux not sending mail kkhan HP-UX 3 01-31-2008 08:27 PM
Mail sending panknil Shell Programming and Scripting 15 09-18-2007 10:24 PM
Sending Mail parmeet UNIX for Dummies Questions & Answers 1 01-23-2007 02:08 AM
sending mail parmeet UNIX for Dummies Questions & Answers 1 01-21-2007 10:32 PM
sending a mail to a mail client solaris73 UNIX for Dummies Questions & Answers 5 11-18-2002 10:58 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-05-2006
Registered User
 

Join Date: Mar 2006
Posts: 25
Question help on sending mail in ksh

folks,

I wrote a script like follow for sending notification email, but the problem is cannot pass the multiple words to the subject line, any help:

=======================================
send_msg () {
send_email $1
exit 1;
}

send_email () {
mail -s $1 $mail_address << MAIL
test
MAIL
}

if [ ! -f test.again ]; then
send_msg "No file found"
fi

======================================

the subject line should be "No file found", but the output from this script only "No", I also tred to put "", but got error msg.

Any help?

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 04-05-2006
Registered User
 

Join Date: Dec 2005
Location: London
Posts: 222
you should do

send_email "$1" instead of send_email $1

same with

mail -s "$1" $mail_address << MAIL
Reply With Quote
  #3  
Old 04-05-2006
Registered User
 

Join Date: Mar 2006
Posts: 25
Smile

that's right, I missed """, thanks.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0