mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Eric Sunshine via GitGitGadget" <>
Cc: "Đoàn Trần Công Danh" <>,
	"Eric Sunshine" <>,
	"Eric Sunshine" <>
Subject: [PATCH] check-non-portable-shell: detect obsolescent egrep/fgrep
Date: Thu, 22 Sep 2022 00:18:25 +0000	[thread overview]
Message-ID: <> (raw)

From: Eric Sunshine <>

GNU grep deprecated `egrep` and `fgrep` with release 2.5.3 in 2007.
As of release 3.8 in 2022, those commands warn[1] that they are
obsolescent. Now that all the Git test scripts have been scrubbed of
uses of `egrep` and `fgrep`, make `check-non-portable-shell` complain
about them to prevent new instances from creeping back into the project.


Signed-off-by: Eric Sunshine <>
    check-non-portable-shell: detect obsolescent egrep/fgrep
    This is atop 'dd/retire-efgrep'.

Fetch-It-Via: git fetch pr-git-1338/sunshineco/efgrep-v1

 t/ | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/ b/t/
index fd3303552be..dd8107cd7da 100755
--- a/t/
+++ b/t/
@@ -45,6 +45,7 @@ while (<>) {
 	/\bhead\s+-c\b/ and err 'head -c is not portable (use test_copy_bytes BYTES <file >out)';
 	/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
 	/\bgrep\b.*--file\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';
+	/\b[ef]grep\b/ and err 'egrep/fgrep obsolescent (use grep -E/-F)';
 	/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
 	/^\s*([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
 		err '"FOO=bar shell_func" assignment extends beyond "shell_func"';

base-commit: 1b3d6e17fe83eb6f79ffbac2f2c61bbf1eaef5f8

                 reply	other threads:[~2022-09-22  0:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).