The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
sending mail from unix anki_1 UNIX for Dummies Questions & Answers 3 04-09-2008 04:03 PM
Sending mail in C/C++ in unix server electroon High Level Programming 6 01-21-2008 11:58 AM
sending mail from unix is failing trichyselva UNIX for Dummies Questions & Answers 1 01-21-2008 04:57 AM
Sending mail thu unix hellotosatish UNIX for Dummies Questions & Answers 6 09-15-2007 09:46 PM
Sending Mail Thru Unix Script Omkumar Shell Programming and Scripting 5 03-31-2005 12:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-01-2008
bobprabhu bobprabhu is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 34
Red face Unix:mail sending issue..pls help me soon

Hi people

Can u help me aorund on this

cat $DISTRIBUTION_LIST | tail -1 | read mailtolist
test -s $INOVOICES.dat
if [ $? -gt 0 ]
then
echo " Sales Report generted" | read subject
mailx -ms "${subject}." $mailtolist
RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
echo "Messaging Failed." >> $LOG_FILE
exit 1
fi
else
echo "NO Report" | read subject
mailx -ms "${subject}." $mailtolist
RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
echo "Messaging Failed." >> $LOG_FILE
exit 1
fi
fi
echo 'END DATE : ' `date` >> $LOG_FILE
exit $RET_CODE


If the file is greater than Zero byte it shuld send a mail with a subject Sales Report generted ,if the file is zero byte,it shuld send a message like No reports.
i created the above code...it's not working ...anybody can help me to modify the script....it's little bit urgent....
  #2 (permalink)  
Old 02-01-2008
ennstate ennstate is offline
Registered User
  
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
May you could try this,

Code:
#!/bin/ksh
 if [[ -s /tmp/report ]] ; then
   echo "Ready to be mailed"
 else
   echo "File is empty"
 fi
Please avoid using "urgent" while posting as this would tend to not to look at it.

Thanks
Nagarajan G
  #3 (permalink)  
Old 02-01-2008
bobprabhu bobprabhu is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 34
thank you!

Last edited by bobprabhu; 02-01-2008 at 06:32 AM..
Sponsored Links
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 09:38 AM.


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