![]() |
|
|
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 |
| How to send a mail in unix--Please read the description | electroon | Shell Programming and Scripting | 2 | 01-03-2008 02:40 AM |
| how other user cannot read my script? | happyv | Shell Programming and Scripting | 19 | 10-02-2006 12:01 PM |
| How to mark ALL mail items as read? | Krispy | UNIX for Dummies Questions & Answers | 3 | 07-17-2006 12:53 PM |
| Tell UW-Imap to read /var/mail/mailbox ?? | d11wtq | UNIX for Dummies Questions & Answers | 2 | 07-13-2005 07:26 PM |
| I need a script that script extract info from mail | meravd | Shell Programming and Scripting | 1 | 10-19-2004 12:15 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
script to read from mail
Hi,
I have a requirement in which I have to read mail from a unix text file and scan records having failed records (any number > 0) Firstly it should compare the file creation_date with sysdate if the dates match then do the checking for failed records sample file i/p Staged 0 records from <file_name> (2 failed) Staged 0 records from <file_name> (0 failed) Staged 0 records from <file_name> (0 failed) 09/27 12:45:46 I 0 Error Transactions 09/27 12:45:46 I 0 Error Transactions 09/27 12:45:46 I 0 Error Transactions code: var1=`grep -w "0 failed" <file_name> var2=`grep -w "0 Error" <file_name> if [[ -n $var1 || -n $var2 ]]; then ..... do something ..... else ..... do something ..... fi; Is there any way I can do in a single command using sed including the file date comparison with sysdate ? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|