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.

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

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)

just posted the same resolution :stuck_out_tongue: ...