diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-08-15 10:52:13 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-08-16 10:12:29 -0700 |
commit | a9515624709865d480e3142fd959bccd1c9372d1 (patch) | |
tree | 64b52c276984353357587c85d31b1056d259b725 /doc | |
parent | e87ccc7038d4f44f4601b3e8775fef09b1420dff (diff) | |
download | grep-a9515624709865d480e3142fd959bccd1c9372d1.tar.gz |
egrep, fgrep: now obsolete
* NEWS: Mention this (see bug#49996).
* doc/Makefile.am (egrep.1 fgrep.1): Remove. All uses removed.
* doc/grep.in.1, doc/grep.texi (grep Programs):
Remove documentation for egrep, fgrep.
* doc/grep.texi (Usage): Add FAQ for egrep and fgrep.
* src/Makefile.am (shell_does_substrings): Substitute for ${0##*/},
not for ${0%/\*} (which was not being used anyway).
* src/egrep.sh: Issue an obsolescence warning.
* tests/fedora: Use "grep -F" instead of "fgrep" in diagnostics,
as this tests "grep -F" not "fgrep".
Diffstat (limited to 'doc')
-rw-r--r-- | doc/.gitignore | 2 | ||||
-rw-r--r-- | doc/Makefile.am | 11 | ||||
-rw-r--r-- | doc/grep.in.1 | 13 | ||||
-rw-r--r-- | doc/grep.texi | 36 |
4 files changed, 27 insertions, 35 deletions
diff --git a/doc/.gitignore b/doc/.gitignore index ac147d27..0151b94c 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,6 +1,4 @@ -/egrep.1 /fdl.texi -/fgrep.1 /gendocs_template /gendocs_template_min /grep.info* diff --git a/doc/Makefile.am b/doc/Makefile.am index 7075e8d6..f6b9f4bd 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -19,20 +19,13 @@ info_TEXINFOS = grep.texi grep_TEXINFOS = fdl.texi -man_MANS = grep.1 fgrep.1 egrep.1 +man_MANS = grep.1 EXTRA_DIST = grep.in.1 -CLEANFILES = grep.1 egrep.1 fgrep.1 +CLEANFILES = grep.1 grep.1: grep.in.1 $(AM_V_GEN)rm -f $@-t $@ $(AM_V_at)sed 's/@''VERSION@/$(VERSION)/' $(srcdir)/grep.in.1 > $@-t $(AM_V_at)chmod a=r $@-t $(AM_V_at)mv -f $@-t $@ - -egrep.1 fgrep.1: Makefile.am - $(AM_V_GEN)rm -f $@-t $@ - $(AM_V_at)inst=`echo grep | sed '$(transform)'`.1 \ - && echo ".so man1/$$inst" > $@-t - $(AM_V_at)chmod a=r $@-t - $(AM_V_at)mv -f $@-t $@ diff --git a/doc/grep.in.1 b/doc/grep.in.1 index e8854f2a..b014f657 100644 --- a/doc/grep.in.1 +++ b/doc/grep.in.1 @@ -137,7 +137,7 @@ .hy 0 . .SH NAME -grep, egrep, fgrep \- print lines that match patterns +grep \- print lines that match patterns . .SH SYNOPSIS .B grep @@ -184,17 +184,6 @@ If no .I FILE is given, recursive searches examine the working directory, and nonrecursive searches read standard input. -.PP -In addition, the variant programs -.B egrep -and -.B fgrep -are the same as -.B "grep\ \-E" -and -.BR "grep\ \-F" , -respectively. -These variants are deprecated, but are provided for backward compatibility. . .SH OPTIONS .SS "Generic Program Information" diff --git a/doc/grep.texi b/doc/grep.texi index 63d2fc9d..3236b98a 100644 --- a/doc/grep.texi +++ b/doc/grep.texi @@ -1159,15 +1159,6 @@ combined with the @option{-z} (@option{--null-data}) option, and note that @end table -In addition, -two variant programs @command{egrep} and @command{fgrep} are available. -@command{egrep} is the same as @samp{grep@ -E}. -@command{fgrep} is the same as @samp{grep@ -F}. -Direct invocation as either -@command{egrep} or @command{fgrep} is deprecated, -but is provided to allow historical applications -that rely on them to run unmodified. - @node Regular Expressions @chapter Regular Expressions @@ -1918,7 +1909,7 @@ before giving it to @command{grep}, or turn to @command{awk}, designed to operate across lines. @item -What do @command{grep}, @command{fgrep}, and @command{egrep} stand for? +What do @command{grep}, @option{-E}, and @option{-F} stand for? The name @command{grep} comes from the way line editing was done on Unix. For example, @@ -1930,8 +1921,29 @@ global/regular expression/print g/re/p @end example -@command{fgrep} stands for Fixed @command{grep}; -@command{egrep} stands for Extended @command{grep}. +The @option{-E} option stands for Extended @command{grep}. +The @option{-F} option stands for Fixed @command{grep}; + +@item +What happened to @command{egrep} and @command{fgrep}? + +7th Edition Unix had commands @command{egrep} and @command{fgrep} +that were the counterparts of the modern @samp{grep -E} and @samp{grep -F}. +Although breaking up @command{grep} into three programs was perhaps +useful on the small computers of the 1970s, @command{egrep} and +@command{fgrep} were not standardized by POSIX and are no longer needed. +In the current GNU implementation, @command{egrep} and @command{fgrep} +issue a warning and then act like their modern counterparts; +eventually, they are planned to be removed entirely. + +If you prefer the old names, you can use use your own substitutes, +such as a shell script named @command{egrep} with the following +contents: + +@example +#!/bin/sh +exec grep -E "$@@" +@end example @end enumerate |