The UNIX and Linux Forums  


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
Help needed - ksh shell scripting subbu Shell Programming and Scripting 5 02-15-2008 12:53 PM
SHell Scripting Help Needed cskumar Shell Programming and Scripting 2 07-17-2006 02:55 AM
Help needed - shell scripting garric Shell Programming and Scripting 8 05-23-2006 07:08 AM
help needed in shell scripting......urgent swamymns Shell Programming and Scripting 3 12-06-2005 11:10 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-16-2008
himvat himvat is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 68
Smile 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
  #2 (permalink)  
Old 11-16-2008
npatwardhan npatwardhan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 135
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
  #3 (permalink)  
Old 11-16-2008
himvat himvat is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 68
Kindly explain me in detail. I am new to scripting
  #4 (permalink)  
Old 11-16-2008
npatwardhan npatwardhan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 135
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 > 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
Closed Thread

Bookmarks

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 10:52 AM.


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