Help needed in shell scripting

" how to write a script to send an error in a log file to a particular E-Mail ID "

Can anyone help me in this ?

Regards

try uuencode..

/usr/bin/uuencode attachment email_attachment.lst > message.txt

cat body_of_message > message.txt

mail-s "Subject line of message" <email address> < message.txt

Kindly explain me in detail. I am new to scripting

Here is something you can try..

  • <LI class=MsoNormal style="mso-list: l0 level1 lfo1">Create one file called message.txt which has the body of the email message. <LI class=MsoNormal style="mso-list: l0 level1 lfo1">Create the attachment file. Lets call it attachment_file.txt
  • Now use the following commands:
    /usr/bin/uuencode attachment_file.txt email_attachment.lst &gt; attachment.txt 

#concatenate message.txt and attachment.txt into combined.txt

cat message.txt attachment.txt > combined.txt

#email combined.txt file. this file has the body of the email and the attachment

mail -s "Message with Attachment" <YOUR EMAIL> < combined.txt