diff --git a/bin/grep b/bin/grep index 1a74f385..268bd474 100755 --- a/bin/grep +++ b/bin/grep @@ -54,7 +54,7 @@ use File::Spec; use File::Temp qw(); use Getopt::Std; -our $VERSION = '1.013'; +our $VERSION = '1.014'; $| = 1; # autoflush output @@ -88,7 +88,7 @@ sub VERSION_MESSAGE { sub usage { die <{'T'}; @@ -453,7 +452,10 @@ FILE: while ( defined( $file = shift(@_) ) ) { $Errors++; next FILE; } - binmode($fh) if $is_binary; + if ($is_binary) { + next FILE if $opt->{'I'}; + binmode $fh; + } } $total = $Matches = 0; @@ -558,7 +560,7 @@ grep - search for regular expressions and print =head1 SYNOPSIS - grep [-incwsxvhHlLFigurpaqT] [-e pattern] [-A NUM] [-B NUM] [-C NUM] + grep [-IincwsxvhHlLFigurpaqT] [-e pattern] [-A NUM] [-B NUM] [-C NUM] [-m NUM] [-f pattern-file] [-P sep] [pattern] [file ...] =head1 DESCRIPTION @@ -642,6 +644,10 @@ Always include filename headers for matching lines or paragraphs. Hide filenames. Only print matching lines or paragraphs. +=item B<-I> + +Ignore binary files. + =item B<-i> Ignore case while matching. This means, for example, that the pattern