help me using awk command....

please help me using awk command in getting the cuurent log..

example:

====> BF0540.e START AT Tue Jul 4 20:06:20 2006

User Id: ccb_dbo

Log File: /home/ccb/prd/joblog/BF0540_05.log
Report File: /home/ccb/prd/report/BF0540_05_0704_2006.rpt
Arguments: /home/ccb/prd/appl/bin/batch/BF0540.e -s5 -L /home/ccb/prd/joblog/BF0540_05.log -R /home/ccb/prd/report/BF0540_05_0704_2006.rpt -
U ccb_dbo -S CCB_PRD -I/home/appl/sybase/server1252/interfaces -P ***

Successfully Completed...

====> BF0540.e STOP AT Tue Jul 4 20:31:14 2006

====> BF0540.e START AT Thu Jul 6 19:24:46 2006

User Id: ccb_dbo

Log File: /home/ccb/prd/joblog/BF0540_05.log
Report File: /home/ccb/prd/report/BF0540_05_0706_1924.rpt
Arguments: /home/ccb/prd/appl/bin/batch/BF0540.e -s5 -L /home/ccb/prd/joblog/BF0540_05.log -R /home/ccb/prd/report/BF0540_05_0706_1924.rpt -
U ccb_dbo -S CCB_PRD -I/home/appl/sybase/server1252/interfaces -P ***

Successfully Completed...

====> BF0540.e STOP AT Thu Jul 6 19:34:43 2006

how can I get the whole current log/paragraph from the word START and STOP including the info between START and STOP.... (using awk)
please help me...:frowning:

Hi,

providing they contain the same lines each time then this will work fine:

awk ' { if ( NR < 12 ) print $0 } ' filename

or if thats coming from some other command then

source | awk ' { if ( NR < 12 ) print $0 } '

ta
Mike

If you want the last log entry and the number of lines in one entry is 12

tail -12 logfile 

number of lines between START and STOP need not be constant...

what ever could be the number of lines..
try this..

tail -`awk 'BEGIN{x=0} { if( $0 ~ /START/ ) {x=NR} } END{print NR-x+1}' inputfile` inputfile