![]() |
|
|
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 |
| Script to find all the files that contain any of the words present in another file | tsanthosh | Shell Programming and Scripting | 4 | 05-21-2008 03:29 AM |
| Segmentation (CoreDump) error !! | varungupta | UNIX for Advanced & Expert Users | 16 | 04-21-2008 06:16 PM |
| how to read all the unique words in a text file | aditya.ece1985 | Shell Programming and Scripting | 5 | 11-30-2007 02:26 AM |
| Read words from file and create new file using K-shell. | bsrajirs | Shell Programming and Scripting | 4 | 06-01-2007 01:15 PM |
| Error closing read file | ALTRUNVRSOFLN | High Level Programming | 1 | 09-18-2006 12:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
script to Read Error,jbase,voilation,segmentation words from a file
Hi,
i need a script to find words "error,jbase,voilation,segmentation" from a file(verify.txt) and if got any of the above words then send an email and if wont find any then execute the cron job. every time it read file verify.txt it must first clear the previous data in the file . Kindly Help as this script is very important for me . Thanks in advance Mujtaba Khan ![]() Last edited by Mujtaba khan; 03-30-2008 at 10:21 AM.. Reason: want to mention that not so much aware of unix scripting |
|
||||
|
man egrep
hint: egrep '(base voilation|error|segmentation)' file If your verification tool doesn't really misspell "violation", you will need to spell it correctly, of course. (^: |
|
||||
|
Need to read "error,voilation" from a text file
Hi,
actually our objective is to execute 2 commands at application level . 1st to verify the application archieve that archieve wont have any error if not then rsyn the archieve files to another location . Here is the detail scenario for u . a process name jlogdup (application level) need to be executed and redirected to a text file named logdup.verify.txt and then from this file script need to find below words "JBASE" , "ERROR" , "Segmentation" , "Voilation" if found then do noting else rsync the archieve to other location (DR) on another machine. regards Mujtaba Khan |
|
||||
|
How nice of you to tell us this. And you want somebody to write the script for you ...? Code:
jlogdup >logdup.verify.txt if ! egrep '(spell|things|correctly)' logdup.verify.txt; then rsync #else # echo "$0: found the strings above; we now go 'eek'" fi If you don't want the file for other purposes then by all means simply jlogdup | egrep If it's properly written it might even send its error messages to standard error, not standard output, in which case you obviously need a bit of redirection. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|