\n-B NUM, --before-context=NUM\nPrint NUM lines of leading context before matching lines.\nPlaces a line containing -- between contiguous groups of\nmatches.\n
Or is the number of lines variable?
In that case:
\n#!/usr/bin/perl -w\nuse strict;\n\nmy $look_for = shift;\n\nmy $last_time_stamp = '';\nmy @current_xml = ();\n\nwhile (<>){\n\n#\n# I need a REAL exmaple of the time stamp line!!\n# Pretend it is MMDDYY : Stuff\n#\nif (/^\\d{6}\\s:/){\n$last_time_stamp = $_;\n@current_xml = ();\nnext;\n}\npush (@current_xml, $_);\n\nif (/$look_for/){\nprint "Found it: [$look_for]\\n";\nprint "$last_time_stamp\\n";\nprint join("\\n",@current_xml),"\\n";\n}\n\n}\n
LRPD:
Somewhere out there, a Big Cheetah is still running WordStar and extremely anal benchmarks...
No it's not:
[link|http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&safe=off&c2coff=1&q=%22big+cheetah%22+pournelle&btnG=Google+Search|http://www.google.co...tnG=Google+Search]
Retired in 1996
I've realized the LRPDs are the ultimite"in" jokes.