Currently I run this command in a script to extract data from a log
cat log|tail -150 |grep "Server Window Start"|grep `date +%d-%m-%Y`|grep -v 13-03-2006
I get the following output:
14-03-2006 00:37:36 Server Window Start: 06:00:00 on 14-03-2006
14-03-2006 06:26:06 Server Window Start: 12:00:00 on 14-03-2006
All is well and good apart from I need the first line that is output.However I cant get this as both lines contain (in some format the time starting 06 therefore i cant grep -v 06: in the original command - any ideas ?
cat log|tail -150 |grep "Server Window Start"|grep `date +%d-%m-%Y`|grep -v 13-03-2006
I get the following output:
14-03-2006 00:37:36 Server Window Start: 06:00:00 on 14-03-2006
14-03-2006 06:26:06 Server Window Start: 12:00:00 on 14-03-2006
All is well and good apart from I need the first line that is output.However I cant get this as both lines contain (in some format the time starting 06 therefore i cant grep -v 06: in the original command - any ideas ?