Hello I have a text file containing the following info:
#[Tue Oct 25 00:00:02 2016] --- START OUTPUT
#CMD: XXX
END-->0<--
#[Tue Oct 25 00:00:57 2016] --- END
#RETURN: 1
#ELAPSED TIME (in seconds): 55
#[Tue Oct 25 00:05:01 2016] --- START OUTPUT
#CMD: XXX
END-->0<--
#[Tue Oct 25 00:05:33 2016] --- END
#RETURN: 0
#ELAPSED TIME (in seconds): 32
I want to get the --End
line the Return
line and the Elapsed
line if its corresponding Return is >
0.
So far I have just been able to grep the Return line grep "#RETURN:" -A 1 -B 1 f.log
But how to i grep only if the Return is >
0 ?
Desired output:
#[Tue Oct 25 00:00:57 2016] --- END
#RETURN: 1
#ELAPSED TIME (in seconds): 55