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
perl/mail - inserting file text in message body thumper Shell Programming and Scripting 2 01-28-2008 03:29 PM
two files as a message in mail ali560045 Shell Programming and Scripting 2 12-13-2007 02:53 AM
Crontab Mail message pankajkrmishra Shell Programming and Scripting 1 09-22-2006 04:36 AM
mail message attachment not complete tine Shell Programming and Scripting 4 03-16-2004 01:20 PM
How to get åäö in e-mail message body de98luto UNIX for Dummies Questions & Answers 4 07-10-2002 05:35 AM

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 01-23-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
pick correct message and mail.

Hi,

I have the following small script. How can I just print out the string with missing message and send to hotmail.com? Also,
can i set the message a bit more beautiful such as "Dear All, the following list is missing in our system"?

#!/bin/sh
MSG=/log
cat list11.txt |
awk ' BEGIN { flag = "y" }
{ if(str != substr($0,1,46))
{
if ( flag == "n" ) print str " is no missing"
str = substr($0,1,46);
seq = substr($0,47,51);
flag = "n"
}
else
{
seq1 = substr($0,47,51)
seq = int(seq) + 1;
if( seq != int(seq1) )
{
flag="y"
while( seq != int(seq1) )
{
printf("%s%05d%s\n", substr($0,1,46), seq, " is missing")
seq = int(seq) + 1;
}
}
}
}' > result.txt
cat result.txt | sort | cut -c 35-70 >> result2.txt
cp result2.txt /log/missing.msg
mailx -s \'"Missing tap file status'" xxxx#hotmail.com < $MSG/missing.msg

Last edited by happyv; 01-23-2007 at 11:34 PM..
  #2 (permalink)  
Old 01-24-2007
Andrek Andrek is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 122
Try changing the last few lines to....

Echo "Dear All\nHere is the list etc etc \n\n" > result2.txt
cat result.txt | sort | cut -c 35-70 >> result2.txt
cat result2.txt | mailx -s "Missing tap file status" xxxx#hotmail.com

In regard to the hotmail email, your server must be configure to handle email requests being sent to the "outside world".....
  #3 (permalink)  
Old 01-24-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
Quote:
Originally Posted by Andrek
Try changing the last few lines to....

Echo "Dear All\nHere is the list etc etc \n\n" > result2.txt
cat result.txt | sort | cut -c 35-70 >> result2.txt
cat result2.txt | mailx -s "Missing tap file status" xxxx#hotmail.com

In regard to the hotmail email, your server must be configure to handle email requests being sent to the "outside world".....
Great..Thx!
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 04:16 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