Last active
December 29, 2015 15:19
-
-
Save k9ert/7689464 to your computer and use it in GitHub Desktop.
you don't want to grep but grab which basically gives you all the lines below your pattern
Can e.g. be used like this:
cat catalina.out | grab 4:02:14.989 | tail -100
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 | |
my @grabbed; | |
while (<STDIN>) { | |
if (/$ARGV[0]/) { | |
print $_; | |
while (<STDIN>) { | |
last if /^$/; | |
print $_; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment