-
-
Save jrelo/218dfd1cfe74016adf68457e8fd35013 to your computer and use it in GitHub Desktop.
Perl's zgrep
This file contains hidden or 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 | |
| use strict; | |
| use warnings; | |
| use PerlIO::gzip; | |
| my $pattern = $ARGV[0]; | |
| my $file = $ARGV[1]; | |
| open my $z, '<:gzip', $file or die "gunzip failed: $!\n"; | |
| while ( <$z> ) { | |
| print if /$pattern/i; | |
| } | |
| close $z; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment