[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Use `grep -E/-F` instead of `egrep` and `fgrep`
From: |
Ville Skyttä |
Subject: |
[PATCH] Use `grep -E/-F` instead of `egrep` and `fgrep` |
Date: |
Mon, 15 Nov 2021 00:04:40 +0200 |
`egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in
current post 3.7 Git they have been made to emit obsolescence warnings:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1
---
README-hacking | 2 +-
contrib/gen-dir-node | 6 +++---
contrib/perldoc-all/GNUmakefile | 2 +-
install-info/tests/defs.in | 3 +--
util/texi2dvi | 2 +-
5 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/README-hacking b/README-hacking
index d9139b5feb..453982f38c 100644
--- a/README-hacking
+++ b/README-hacking
@@ -295,7 +295,7 @@ gnupload --to ftp.gnu.org:texinfo !$
update home page (texinfo.html) and commit as needed.
including:
pod2html $txi/Pod-Simple-Texinfo/pod2texi.pl \
- | fgrep -v 'rev="made"' >manual/pod2texi.html
+ | grep -Fv 'rev="made"' >manual/pod2texi.html
Build web documentation with
make -C doc wwwdoc-build
diff --git a/contrib/gen-dir-node b/contrib/gen-dir-node
index 7b4bc028e5..8b413bbf7a 100755
--- a/contrib/gen-dir-node
+++ b/contrib/gen-dir-node
@@ -78,7 +78,7 @@ moobler
### then generate entries for those in the same way, putting the info for
### those at the end....
-infofiles=`(cd ${INFODIR}; /bin/ls | grep -v '\-[0-9]*$' | egrep -v
'^dir$|^dir\.info$|^dir\.orig$')`
+infofiles=`(cd ${INFODIR}; /bin/ls | grep -v '\-[0-9]*$' | grep -Ev
'^dir$|^dir\.info$|^dir\.orig$')`
# echoing gets clobbered by backquotes; we do it the hard way...
lines=`wc $SKELETON | awk '{print $1}'`
@@ -165,8 +165,8 @@ fi
# Sort remaining files by INFO-DIR-SECTION.
prevsect=
-filesectdata=`(cd ${INFODIR}; fgrep INFO-DIR-SECTION /dev/null ${infofiles} | \
- fgrep -v 'INFO-DIR-SECTION Miscellaneous' | \
+filesectdata=`(cd ${INFODIR}; grep -F INFO-DIR-SECTION /dev/null ${infofiles}
| \
+ grep -Fv 'INFO-DIR-SECTION Miscellaneous' | \
sort -t: -k2 -k1 | tr ' ' '_')`
for sectdata in ${filesectdata}; do
file=`echo ${sectdata} | cut -d: -f1`
diff --git a/contrib/perldoc-all/GNUmakefile b/contrib/perldoc-all/GNUmakefile
index 227a11ca8c..f9425c4666 100644
--- a/contrib/perldoc-all/GNUmakefile
+++ b/contrib/perldoc-all/GNUmakefile
@@ -61,7 +61,7 @@ $(texi_pod_doc_incl): $(perl_pod_subdir)/*.pod
cd $(perl_pod_subdir) \
&& perl -p -i.bak -e 's,X<.*?>>?,,g' *.pod \
&& $(pod2texi) -o $@ $(pod2texi_args) \
- `ls *.pod | egrep -v "(delta|unicook)"` \
+ `ls *.pod | grep -Ev "(delta|unicook)"` \
&& mv $(texi_pod_subdir) $@ ../..
# updating on www.gnu.org. We do not install the split HTML files
diff --git a/install-info/tests/defs.in b/install-info/tests/defs.in
index c15fc73336..e31a646b68 100644
--- a/install-info/tests/defs.in
+++ b/install-info/tests/defs.in
@@ -60,8 +60,7 @@ if test -z "$TMPDIR"; then
export TMPDIR
fi
-# In case someone pedantic insists on using grep -E.
-: ${EGREP=egrep}
+: ${EGREP=grep -E}
# Systems which define $COMSPEC or $ComSpec use semicolons to separate
# directories in TEXINPUTS -- except for Cygwin et al., where COMSPEC
diff --git a/util/texi2dvi b/util/texi2dvi
index 241ad6817a..47eb088fcc 100755
--- a/util/texi2dvi
+++ b/util/texi2dvi
@@ -74,7 +74,7 @@ newline='
'
IFS="$space$tab$newline"
-: ${EGREP=egrep}
+: ${EGREP=grep -E}
# Systems which define $COMSPEC or $ComSpec use semicolons to separate
# directories in TEXINPUTS -- except for Cygwin and Msys, where COMSPEC
--
2.25.1
- [PATCH] Use `grep -E/-F` instead of `egrep` and `fgrep`,
Ville Skyttä <=