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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mailx commannd - Mail and Attachment in same mail sharif UNIX for Advanced & Expert Users 6 03-19-2008 04:25 PM
mail with attachment param786 Shell Programming and Scripting 1 07-15-2007 11:20 AM
Sending attachment thru a mail Rohini Vijay UNIX for Dummies Questions & Answers 1 05-12-2006 01:13 PM
mail attachment sushrut UNIX for Dummies Questions & Answers 3 08-28-2001 02:14 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 12-06-2005
lesstjm lesstjm is offline
Registered User
  
 

Join Date: Nov 2001
Posts: 59
How To Add Attachment to Mail

I have a shell script that executes and sends out an email. Currently I cat out a report into the body of the email.

mailx -s "My Report: ${ORACLE_SID} ($FILEDATE)" \
myemail@us.com < ${LOG_DIR}/${ORACLE_SID}_audit.log

Is there a way to just attach the report to the email instead? I want to attach ${LOG_DIR}/${ORACLE_SID}_audit.log instead of cat into the body of the email.
  #2 (permalink)  
Old 12-06-2005
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Code:
uuencode ${LOG_DIR}/${ORACLE_SID}_audit.log ${LOG_DIR}/${ORACLE_SID}_audit.log.txt | mailx -s "My Report: ${ORACLE_SID} ($FILEDATE)" "myemail@us.com"
  #3 (permalink)  
Old 12-06-2005
Bhups Bhups is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 23
ooopsss...sorry matrix..dint saw ur reply:-)...

Quote:
Originally Posted by matrixmadhan
Code:
uuencode ${LOG_DIR}/${ORACLE_SID}_audit.log ${LOG_DIR}/${ORACLE_SID}_audit.log.txt | mailx -s "My Report: ${ORACLE_SID} ($FILEDATE)" "myemail@us.com"
just posted the same resolution ...
  #4 (permalink)  
Old 12-06-2005
Bhups Bhups is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 23
uuencode for attchments..

u can use uuencode utility to attch a file
command:

cat mail_contant.txt ; uuencode ${LOG_DIR}/${ORACLE_SID}_audit.log ${LOG_DIR}/${ORACLE_SID}_audit.log | mailx -s mailx -s "My Report: ${ORACLE_SID} ($FILEDATE)" myemail@us.com

dont get confused due to writing the input file name twice...its like "encode input file name outputfilename"
input file =${LOG_DIR}/${ORACLE_SID}_audit.log
output=${LOG_DIR}/${ORACLE_SID}_audit.log (here both file names are same...but u can give a different file name to the encoded file)
Closed Thread

Bookmarks

Tags
mailx, mailx attachment

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 04:01 PM.


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