Skip to content

Instantly share code, notes, and snippets.

@poeli
Created May 17, 2018 21:40
Show Gist options
  • Save poeli/70e993262f40e00e64d77b2990f5661a to your computer and use it in GitHub Desktop.
Save poeli/70e993262f40e00e64d77b2990f5661a to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
$string=$ARGV[0];
$cnt=0;
$found=1;
while(<STDIN>){
if( $cnt%4==0){
if( /$string/i ){
$found=1;
print $_;
}
else{
$found=0;
}
}
elsif( $found ){
print $_;
}
$cnt++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment