If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > unable to email with attachment

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-07, 18:31
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
unable to email with attachment

I am on SunOS 5.8

My shell script creates 2 files, one called TSummary.lst and the other one identified by $LOG_FILE

I am trying to send me an email (email-ids are listed in email_lst.txt) with the TSummary.lst as an attachement & the LOG_FILE printed as the contents of the same email.

I get the email with the contents of the $LOG_FILE but not getting the attachment.

Here is what I am doing :

cat /path/email_lst.txt | while read Line
do
(uuencode ${LOGDIR}/TSummary.lst) | \
mailx -r "T Summary" -s "Summary Notification" $Line < $LOG_FILE
done
exit 0

Where am I going wrong?

Thanks
Reply With Quote
  #2 (permalink)  
Old 08-23-07, 11:21
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
I found the problem...the below works...

cat /data/dev/ins/dbi/vpaspr/email_lst.txt | while read Line
do
(cat $LOG_FILE;uuencode ${LOGDIR}/TSummary.lst ${LOGDIR}/TSummary.lst) | \
mailx -r "T Summary" -s "Summary Notification" $Line
done
exit 0
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On