![]() |
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 |
| Shell script to search for text in a file and copy file | imeadows | UNIX for Dummies Questions & Answers | 9 | 11-12-2008 09:12 PM |
| Copy lines from a log file based on timestamp | ranjiadmin | UNIX for Advanced & Expert Users | 1 | 05-22-2008 03:16 AM |
| copy lines from opne file to another | HIMANI | UNIX for Dummies Questions & Answers | 2 | 03-15-2008 05:57 AM |
| How to copy multiple lines from a file to another using AWK? | jisha | Shell Programming and Scripting | 3 | 01-08-2008 01:04 AM |
| Copy only the initial 10 lines from a file to another | jockey007 | Shell Programming and Scripting | 5 | 11-02-2007 02:05 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Script to capture new lines in a file and copy it to new file
Hi All,
I have a file that gives me new line/output every 5 minutes. I need to create a script that capture new line/output besides "IN CRON_STATUS", in this case the new output is "begin ------ cron_status.sh - [started] -----------". I want this script to capture the line starting from "begin ------ cron_status.sh - [started] -----------" until it reads "IN CRON_STATUS" again. If the script notice the "IN CRON_STATUS", it will stop capturing and direct the output to a different file name and rename it to the original name but with timestamp. Sample; ---------05/21/08-05:00:00-------- IN CRON_STATUS ----------------------------------- ---------05/21/08-05:00:00-------- IN CRON_STATUS ----------------------------------- ---------05/21/08-05:05:00-------- IN CRON_STATUS ----------------------------------- ---------05/21/08-05:05:00-------- IN CRON_STATUS ----------------------------------- ---------05/21/08-05:15:00-------- IN CRON_STATUS ----------------------------------- --------------------------------------- begin ------ cron_status.sh - [started] ----------- - Message Started found in /RCEBTM_appli/RCEBMA/mbox/hubftpa - Starting Tuxedo ---------05/21/08-05:15:00-------- IN CRON_STATUS ----------------------------------- ---[CRON]---05/21/08-05:15:00-------- Message Started found in /RCEBTM_appli/RCEBMA/log ---[CRON]---05/21/08-05:15:00-------- Starting RCE ---[CRON]---05/21/08-05:15:00-------- Starting RCE servers ... XXXXX.XXXXX!BBL.21394: 052108: TUXEDO Version 6.5 HP-UX B.11.00 U XXXX/XXXXXXX unlimited-user license. - sending file with ftp: success ---------05/21/08-19:55:00-------- IN CRON_STATUS ----------------------------------- ---------05/21/08-19:55:00-------- IN CRON_STATUS ----------------------------------- ---------05/21/08-20:00:00-------- IN CRON_STATUS ----------------------------------- Please advise. Thank you in advance. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|