Created
April 13, 2012 08:51
-
-
Save oopsops/2375192 to your computer and use it in GitHub Desktop.
SplitTraceLog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#Usage checkLTrace.pl [keyword] [filepath] | |
#use strict; | |
#use warnings; | |
if (@ARGV < 2) { exit(1); }; | |
$grepword = $ARGV[0]; | |
$filename = $ARGV[1]; | |
open(IN, "< $filename"); | |
read (IN, $buf, (-s "$filename")); | |
close IN; | |
@list = split(/\n[0-9][0-9]:[0-9][0-9]:[0-9][0-9] /, $buf); | |
@result = grep(/$grepword/, @list); | |
print "Latest $grepword --\n"; | |
print "$result[$#result]\n"; | |
print "End --\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment