Hi, i have file f1.txt with data like:
CHECK
a
b
CHECK
c
d
CHECK
e
f
JOB_START
....
I want to match the last occurrence of 'CHECK' until the end of the file.
I can use awk:
awk '/^CHECK/ { buf = "" } { buf = buf "\n" $0 } END { print buf }' f1.txt | tail +2
Is there a cleaner way of doing this used 'sed' command?
Our server is HP-UX 11.11 and 'tac' utility is not available, in case your solution suggests reversing the lines in the file first !
Thanks,
-srinivas yelamanchili