![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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.. |
|
||||
|
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"..... |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|