Skip to content

Commit 9555402

Browse files
authored
grep: retire GREP_OPTIONS (#897)
* I discovered that GNU grep 3.6 on my Linux system completely ignores GREP_OPTIONS * I did a little reading and the feature had been removed from GNU grep (probably for security reasons) * Original BSD grep, and current OpenBSD grep doesn't have GREP_OPTIONS, so remove it (it's not a standard thing anyway)
1 parent 62af3b7 commit 9555402

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

bin/grep

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ Options:
122122
-s suppress errors for failed file and dir opens
123123
-T trace files as opened
124124
-Z force grep to behave as zgrep
125-
126-
May use GREP_OPTIONS environment variable to set default options.
127125
EOF
128126
}
129127

@@ -212,11 +210,6 @@ sub parse_args {
212210
}
213211
};
214212

215-
if ( defined( $_ = $ENV{'GREP_OPTIONS'} ) ) {
216-
s/^([^\-])/-$1/; # add leading - if missing
217-
unshift @ARGV, $_;
218-
}
219-
220213
# multiple -e/-f options
221214
my $opt_f = 0;
222215
my @tmparg;
@@ -728,8 +721,7 @@ searching for the pattern.
728721
729722
=head1 ENVIRONMENT
730723
731-
The GREP_OPTIONS environment variable is taken as the default set of
732-
options to grep, placed at the front of any explicit options.
724+
The TERM variable is used for output formatting in the -g and -u options.
733725
734726
=head1 EXAMPLES
735727

0 commit comments

Comments
 (0)