Created
May 17, 2018 21:40
-
-
Save poeli/70e993262f40e00e64d77b2990f5661a to your computer and use it in GitHub Desktop.
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/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