I need some help please...
This is the scenario what I am sitting with.
1 - I am kicking of a batch script.
2 - This batch script is writing to an active log file which is also use by other batch scripts.
3 - I need to monitor this active log file and grep for the script name as well as the status of the script as soon as it ends.
4 - There will be other scripts writing to this active log file which will have a status as well when ending.
So, the idea is to have the following:
1 - A script that will view the active log file, which is called from command line: "viewlog"
2- grep for the "script name" and the "status" and the "status code" whithin the same line
3 - Script need to exit with the "status code" that is produced within this active log file.
Here is an example of the active log file lines, the highlighted line is the line with the "script name", "status" and "status code":
1/19/2011 12:07:04 unikixvsam4 :KIX0501I Executing /pinv/invest1/io07210std/src/BBCONVRT.gnt
01/19/2011 12:07:04 unikixvsam4 :KIX0503I Terminating /pinv/invest1/io07210std/src/BBCONVRT.gnt
01/19/2011 12:07:04 unikixtran4 :KIX0314I Batch job BMI_TA_pdpg.ks ended, status = 0
01/19/2011 12:07:03 unikixvsam4 :KIX0503I Terminating /pinv/invest1/io07210std/src/ARPCR1.gnt
01/19/2011 12:07:04 unikixvsam4 :KIX0301I Entering (VER. 8.1.0p8 - 11/13/2007 )
01/19/2011 12:07:04 unikixvsam4 :KIX1001I Connected to database MQSeries
01/19/2011 12:07:04 unikixvsam4 :KIX0501I Executing /pinv/invest1/io07210std/src/BBCONVRT.gnt
Any help will be appreciated...
Thank You
Henk