Skip to content

Instantly share code, notes, and snippets.

@k9ert
Last active December 29, 2015 15:19
Show Gist options
  • Save k9ert/7689464 to your computer and use it in GitHub Desktop.
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
#!/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