Attachment at Shell script [message #438380] |
Fri, 08 January 2010 08:38 |
pokhraj_d
Messages: 117 Registered: December 2007
|
Senior Member |
|
|
Hi,
I have written one shell script which will create log file named
Need_Index_rebuild.lst.
Now I want to send the file "Need_Index_rebuild.lst" as an attachment through mail to respective DBAs.
The mail is coming successfully through Unix box to the Outlook without attachment, but not able to attach the file with the mail.
Please help.
Regards-
Pokhraj Das
|
|
|
|
|
|
Re: Attachment at Shell script [message #438676 is a reply to message #438664] |
Mon, 11 January 2010 13:16 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
you'll probably find unix2dos useful to in giving the correct new-line styles.
## varies by platform
#UX2DOS=/usr/bin/ux2dos
UX2DOS="/usr/bin/unix2dos -437"
# convert Unix style new lines to Windows style
UX2DOS $LOG > $LOG.tmp
mv $LOG.tmp $LOG
mailx -s "Log attached..." $TO 1>/dev/null <<EOF
$(printf "Here is your log...\n";\
printf "--------------------------------------------\n\n";\
uuencode $LOG your_log.txt;\
printf "--------------------------------------------\n\n")
EOF
[Updated on: Mon, 11 January 2010 13:17] Report message to a moderator
|
|
|