From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:22:59 2021 Received: (at submit) by debbugs.gnu.org; 11 Aug 2021 07:22:59 +0000 Received: from localhost ([127.0.0.1]:33177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiZn-0002oR-Jn for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:22:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:52712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiZl-0002oJ-H0 for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:22:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDiZk-0000Wq-Qf for bug-grep@gnu.org; Wed, 11 Aug 2021 03:22:57 -0400 Received: from uggla.sjd.se ([2001:9b1:8633::107]:41290) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDiZi-000083-KQ for bug-grep@gnu.org; Wed, 11 Aug 2021 03:22:56 -0400 DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=ed2101; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7Y76Tsrw2ASpmsBprp8meKf/HS3n75pc8EwcBe/XDRU=; t=1628666569; x=1629876169; b=wouNBEl7KewxpDcwKSpDE/b0ftisT0L7pgauFWnNOccZwoEHPRuy3MSD7TK5vpGv5D7HxdicV1 BofnTgAeZfDw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=rsa2101; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7Y76Tsrw2ASpmsBprp8meKf/HS3n75pc8EwcBe/XDRU=; t=1628666569; x=1629876169; b=rP0Tuqulilg6nQH3jFU+msWs8y2fMLCra/KC7S4lIFJ9i4ScFATY4elxz9P4cCU7NvyEjFWbaO nB5dRwHnDBaPiB7YwcAbhPwxBDw92VEFSz/dXdTv6jNROvO8eAm7RPpVbKrZNn7oH9itzBZWRn798 0wIbK4BONpXSfzaHPLSBlhlpTbFDyVQwPDj24+fLKdiVo33L2/6iJcPnSvQJL8wZ0nmp4xNnR53cV Msrx3dyreTaJIo3VdrG6FoXk/CIJjpaZWGL6GoLTYv5i70njDmYusUk08htkfCtpMAoNcapD8WBv5 JQ+j21htYQoI9UqEeE9LVJoDwd3y5RrRhOf/gNwAYHmc+2FSCyF+esO1e9+omzf2TXWgs5ACi/+yI 8NzlYHtx1vlrxDoaFKF50mWKG0eVacJ8dG9AcueOaXcpOxusX0Z0PNOZW8ioHgsjSKEEHW572j ; Received: from [2001:9b1:41ac:ff00:4766:47d7:a458:86d5] (port=37144 helo=latte) by uggla.sjd.se with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDiZa-00074f-HA for bug-grep@gnu.org; Wed, 11 Aug 2021 07:22:46 +0000 X-Hashcash: 1:22:210811:bug-grep@gnu.org::KrPD2kwzIlV15vT3:VwHO From: Simon Josefsson To: bug-grep@gnu.org Subject: egrep and fgrep? OpenPGP: id=B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE; url=https://josefsson.org/key-20190320.txt Date: Wed, 11 Aug 2021 09:22:45 +0200 Message-ID: <87eeb0o37e.fsf@latte.josefsson.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:9b1:8633::107; envelope-from=simon@josefsson.org; helo=uggla.sjd.se X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hi! A long standing pet issue of mine are the "deprecated" (since 2005?) tools fgrep and egrep. If there is any meaning to the term "deprecated", maybe they should be dropped at some point, or the deprecation-status escalated (stderr warning? syslog output?). What do you think? Maybe now is an acceptable time to drop them, I recall seeing some more recent distributions that do not provide them, and things appears to work for them except for the rare bug here and there. Alternatively, how about un-deprecating them, for compatibility with BSD and deployed popular usage. I must admint I use egrep quite often. I think un-deprecating tools/APIs is an acceptable thing to do in some cases. Maybe a middle-ground could exist, that they won't be installed (or work?) in some "POSIX"-mode -- I think the main reason for deprecating them was that POSIX dropped a requirement for them? That doesn't necessarily mean things must be deprecated. /Simon --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYIADIWIQSjzJyHC50xCrrUzy9RcisI/kdFogUCYRN6xhQcc2ltb25Aam9z ZWZzc29uLm9yZwAKCRBRcisI/kdFomz4AP0aVQeQ870rIqsRvHuS3C5HY3Gp7oZQ Q7BgRDF8nw+dqQEAp0MINZEwXLipxyMGzT5Qv+ek0ufTX5vhaWfwpDVQuwE= =ALLe -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:34:13 2021 Received: (at 49996) by debbugs.gnu.org; 11 Aug 2021 07:34:13 +0000 Received: from localhost ([127.0.0.1]:33218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDikf-00037s-HR for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:34:13 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDikd-00037e-9M for 49996@debbugs.gnu.org; Wed, 11 Aug 2021 03:34:12 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C8A1E1600F1; Wed, 11 Aug 2021 00:34:05 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NpRN5wAGscLd; Wed, 11 Aug 2021 00:34:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2C0CB1600F3; Wed, 11 Aug 2021 00:34:05 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MyMy-vrx-N69; Wed, 11 Aug 2021 00:34:05 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 063431600F1; Wed, 11 Aug 2021 00:34:05 -0700 (PDT) Subject: Re: bug#49996: egrep and fgrep? To: Simon Josefsson References: <87eeb0o37e.fsf@latte.josefsson.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> Date: Wed, 11 Aug 2021 00:34:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87eeb0o37e.fsf@latte.josefsson.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 49996 Cc: 49996@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) On 8/11/21 12:22 AM, Simon Josefsson via Bug reports for GNU grep wrote: > I think the main reason for deprecating > them was that POSIX dropped a requirement for them? As I recall, it was because they were kinda useless cruft. Portable scripts can't use egrep and fgrep since they're not standardized, and for personal command-line usage aliases suffice and 'eg' is a better alias anyway (it's less typing). From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 14 06:43:28 2021 Received: (at 49996) by debbugs.gnu.org; 14 Aug 2021 10:43:28 +0000 Received: from localhost ([127.0.0.1]:43638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEr8S-0002s6-Kb for submit@debbugs.gnu.org; Sat, 14 Aug 2021 06:43:28 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:46933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEr8Q-0002rt-QV for 49996@debbugs.gnu.org; Sat, 14 Aug 2021 06:43:27 -0400 Received: by mail-wm1-f48.google.com with SMTP id h24-20020a1ccc180000b029022e0571d1a0so8479716wmb.5 for <49996@debbugs.gnu.org>; Sat, 14 Aug 2021 03:43:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/0FOf7WpAzt0yLfUQh1yMMTg7K3jKHAMDKTFWhj9WUs=; b=ddW5wLjZ9DmSOFKVYPDr6LjJHdNiPWvEdj3d1HYvTXUrbuRl+ZPwaAvhfBQYIqlDfL Lqwhuj/L/5wLlyAVybth3Z1CVSy6r7rQ43XBOR39PUuS0qL9p3EyBv2SP1rBCimKYX6P QI9EtOw6gaGN7F9y57jjRULsA72mX5NmJ2b8EGm/ZM+ibQrgNHTrGA84B6SO1Vs3hCBO kIMuqqJm20dLJ5SrcvyFswt/dxZBKwUsMLD04sONy7QlX/0IqEe8z4mPST7wGznzmyZk vKWFBI78L+QngmoW/TMVoDmS9xhJFo+h2S4R8KDQ9DYPVfUTtPoLhI3AbdNIzlLJZ0Gj rxoA== X-Gm-Message-State: AOAM530CRtNFct4V1ve6NfZv39j2TV/UI5kpzKm4ex9QpdUBPapPjITH C7m1+zRxgknFYKimgbzDAp/vAf08VazDGGYAD1U= X-Google-Smtp-Source: ABdhPJy9SOS0aDsZEKtMSEnfwxYWMkv3ayR62/0oOiavKL3RtbE67Qqnm94LPMEDhI3q6cWeFzSrZul0lvtyzPveS8Y= X-Received: by 2002:a1c:7719:: with SMTP id t25mr6695042wmi.130.1628937801053; Sat, 14 Aug 2021 03:43:21 -0700 (PDT) MIME-Version: 1.0 References: <87eeb0o37e.fsf@latte.josefsson.org> <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> In-Reply-To: <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> From: Jim Meyering Date: Sat, 14 Aug 2021 12:43:09 +0200 Message-ID: Subject: Re: bug#49996: egrep and fgrep? To: Paul Eggert Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 49996 Cc: 49996@debbugs.gnu.org, Simon Josefsson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On Wed, Aug 11, 2021 at 9:35 AM Paul Eggert wrote: > On 8/11/21 12:22 AM, Simon Josefsson via Bug reports for GNU grep wrote: > > I think the main reason for deprecating > > them was that POSIX dropped a requirement for them? > > As I recall, it was because they were kinda useless cruft. Portable > scripts can't use egrep and fgrep since they're not standardized, and > for personal command-line usage aliases suffice and 'eg' is a better > alias anyway (it's less typing). IMHO, they must be removed. Anyone who requires to be able to use "egrep" or "fgrep" from the command line can use a function or alias. Given their lack of standardization, those should not be used in scripts. My only questions are "when?" and "how?". I.e. first release intermediate scripts that emit a warning every time they are used, or just drop them from the list of installed targets. I won't do either now, but they've been deprecated for so long I'll definitely consider it for the next release. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 10:26:11 2021 Received: (at 49996) by debbugs.gnu.org; 15 Aug 2021 14:26:11 +0000 Received: from localhost ([127.0.0.1]:47558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFH5X-0006yT-0b for submit@debbugs.gnu.org; Sun, 15 Aug 2021 10:26:11 -0400 Received: from freefriends.org ([96.88.95.60]:43570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFH5T-0006yH-Np for 49996@debbugs.gnu.org; Sun, 15 Aug 2021 10:26:09 -0400 X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 17FEPrDw029026 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Aug 2021 08:25:54 -0600 Received: (from arnold@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 17FEPpXw029025; Sun, 15 Aug 2021 08:25:51 -0600 From: arnold@skeeve.com Message-Id: <202108151425.17FEPpXw029025@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Sun, 15 Aug 2021 08:25:51 -0600 To: jim@meyering.net, eggert@cs.ucla.edu Subject: Re: bug#49996: egrep and fgrep? References: <87eeb0o37e.fsf@latte.josefsson.org> <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> In-Reply-To: User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49996 Cc: 49996@debbugs.gnu.org, simon@josefsson.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Jim Meyering wrote: > IMHO, they must be removed. > Anyone who requires to be able to use "egrep" or "fgrep" from the > command line can use a function or alias. Given their lack of > standardization, those should not be used in scripts. I beg to differ. Scripts is one thing. But breaking 40+ years of interactive usage merely because POSIX doesn't standardize fgrep and egrep (anymore!) is doing thousands of users a disservice. As software suppliers, we need to take into account the bigger picture of day-to-day usage, and not only what POSIX standardizes and doesn't standardize. And I'm willing to bet that the majority of grep/egrep/fgrep invocations come from the command line rather than from scripts. Arnold From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 14:11:22 2021 Received: (at 49996) by debbugs.gnu.org; 15 Aug 2021 18:11:22 +0000 Received: from localhost ([127.0.0.1]:47718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFKbO-0002Ti-34 for submit@debbugs.gnu.org; Sun, 15 Aug 2021 14:11:22 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFKbH-0002TO-OG for 49996@debbugs.gnu.org; Sun, 15 Aug 2021 14:11:16 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 72FFC16005D; Sun, 15 Aug 2021 11:11:05 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 8gLJhz4_wNOu; Sun, 15 Aug 2021 11:11:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 168CC160076; Sun, 15 Aug 2021 11:11:00 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 88SQOas0EuFl; Sun, 15 Aug 2021 11:10:59 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D8E0E16005D; Sun, 15 Aug 2021 11:10:59 -0700 (PDT) To: arnold@skeeve.com, jim@meyering.net References: <87eeb0o37e.fsf@latte.josefsson.org> <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> <202108151425.17FEPpXw029025@freefriends.org> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: bug#49996: egrep and fgrep? Message-ID: <864f7326-48cc-86ed-cbca-502ebded54f5@cs.ucla.edu> Date: Sun, 15 Aug 2021 11:10:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <202108151425.17FEPpXw029025@freefriends.org> Content-Type: multipart/mixed; boundary="------------5282E6B4E062647AD8B72282" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 49996 Cc: 49996@debbugs.gnu.org, simon@josefsson.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------5282E6B4E062647AD8B72282 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/15/21 7:25 AM, arnold@skeeve.com wrote: > I'm willing to bet that the majority of grep/egrep/fgrep invocations > come from the command line rather than from scripts. That's not true for me, as I almost always invoke 'grep' via a script or=20 shell function or Emacs. And I'm skeptical that it's true worldwide. I doubt whether we should remove egrep and fgrep immediately, as that'd=20 be a bit sudden. But it's a good time to take the next step. Proposed=20 patch attached. --------------5282E6B4E062647AD8B72282 Content-Type: text/x-patch; charset=UTF-8; name="0001-egrep-fgrep-now-obsolete.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-egrep-fgrep-now-obsolete.patch" =46rom 6bd26c3e37d63c431f0064a22d528f754c150ce1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 15 Aug 2021 10:52:13 -0700 Subject: [PATCH] egrep, fgrep: now obsolete * NEWS: Mention this. * 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 a obsolescence warning. * tests/fedora: Use "grep -F" instead of "fgrep" in diagnostics, as this tests "grep -F" not "fgrep". --- NEWS | 5 +++++ doc/.gitignore | 2 -- doc/Makefile.am | 11 ++--------- doc/grep.in.1 | 13 +------------ doc/grep.texi | 36 ++++++++++++++++++++++++------------ src/Makefile.am | 4 ++-- src/egrep.sh | 2 ++ tests/fedora | 4 ++-- 8 files changed, 38 insertions(+), 39 deletions(-) diff --git a/NEWS b/NEWS index 39a0903..4a62fb7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,11 @@ GNU grep NEWS -*- out= line -*- =20 * Noteworthy changes in release ?.? (????-??-??) [?] =20 +** Changes in behavior + + The egrep and fgrep commands, which have been deprecated since + release 2.5.3 (2007), now warn that they are obsolescent and should + be replaced by grep -E and grep -F. =20 * Noteworthy changes in release 3.7 (2021-08-14) [stable] =20 diff --git a/doc/.gitignore b/doc/.gitignore index ac147d2..0151b94 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 7075e8d..f6b9f4b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -19,20 +19,13 @@ info_TEXINFOS =3D grep.texi grep_TEXINFOS =3D fdl.texi =20 -man_MANS =3D grep.1 fgrep.1 egrep.1 +man_MANS =3D grep.1 =20 EXTRA_DIST =3D grep.in.1 -CLEANFILES =3D grep.1 egrep.1 fgrep.1 +CLEANFILES =3D grep.1 =20 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=3Dr $@-t $(AM_V_at)mv -f $@-t $@ - -egrep.1 fgrep.1: Makefile.am - $(AM_V_GEN)rm -f $@-t $@ - $(AM_V_at)inst=3D`echo grep | sed '$(transform)'`.1 \ - && echo ".so man1/$$inst" > $@-t - $(AM_V_at)chmod a=3Dr $@-t - $(AM_V_at)mv -f $@-t $@ diff --git a/doc/grep.in.1 b/doc/grep.in.1 index e8854f2..b014f65 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 compatibili= ty. . .SH OPTIONS .SS "Generic Program Information" diff --git a/doc/grep.texi b/doc/grep.texi index 63d2fc9..3236b98 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 =20 @end table =20 -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. - =20 @node Regular Expressions @chapter Regular Expressions @@ -1918,7 +1909,7 @@ before giving it to @command{grep}, or turn to @com= mand{awk}, designed to operate across lines. =20 @item -What do @command{grep}, @command{fgrep}, and @command{egrep} stand for? +What do @command{grep}, @option{-E}, and @option{-F} stand for? =20 The name @command{grep} comes from the way line editing was done on Unix= =2E For example, @@ -1930,8 +1921,29 @@ global/regular expression/print g/re/p @end example =20 -@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 =20 @end enumerate =20 diff --git a/src/Makefile.am b/src/Makefile.am index c2e6e9a..db1bb3f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,11 +54,11 @@ EXTRA_DIST =3D egrep.sh egrep fgrep: egrep.sh Makefile $(AM_V_GEN)grep=3D`echo grep | sed -e '$(transform)'` && \ case $@ in egrep) option=3D-E;; fgrep) option=3D-F;; esac && \ - shell_does_substrings=3D'set x/y && d=3D$${1%/*} && test "$$d" =3D x' &= & \ + shell_does_substrings=3D'set x/y && d=3D$${1##*/} && test "$$d" =3D y' = && \ if $(SHELL) -c "$$shell_does_substrings" 2>/dev/null; then \ edit_substring=3D's,X,X,'; \ else \ - edit_substring=3D's,\$${0%/\*},`expr "X$$0" : '\''X\\(.*\\)/'\''`,g';= \ + edit_substring=3D's,\$${0##\*/},`expr "X$$0" : '\''X\\(.*\\)/'\''`,g'= ; \ fi && \ sed -e 's|[@]SHELL@|$(SHELL)|g' \ -e "$$edit_substring" \ diff --git a/src/egrep.sh b/src/egrep.sh index 6d6c15a..a0d1694 100644 --- a/src/egrep.sh +++ b/src/egrep.sh @@ -1,2 +1,4 @@ #!@SHELL@ +cmd=3D${0##*/} +echo "$cmd: warning: $cmd is obsolescent; using @grep@ @option@" >&2 exec @grep@ @option@ "$@" diff --git a/tests/fedora b/tests/fedora index 43650f3..bd5527e 100755 --- a/tests/fedora +++ b/tests/fedora @@ -18,7 +18,7 @@ ok () { printf "${G}OK${D}"; } fail () { printf "${R}FAIL${D} (See ${U})"; failures=3D1; } =20 U=3Dhttps://bugzilla.redhat.com/show_bug.cgi?id=3D116909 -printf "fgrep false negatives: " +printf "grep -F false negatives: " cat > 116909.list < /dev/null 2>&1; then echo foobar | returns_ 124 timeout 10 grep -Fw "" && fail || ok =20 U=3Dhttps://bugzilla.redhat.com/show_bug.cgi?id=3D140781 - printf 'fgrep hangs on binary files: ' + printf 'grep -F hangs on binary files: ' returns_ 124 timeout 10 grep -F grep "$abs_top_builddir/src/grep" \ > /dev/null && fail || ok =20 --=20 2.30.2 --------------5282E6B4E062647AD8B72282-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 16 07:34:46 2021 Received: (at 49996) by debbugs.gnu.org; 16 Aug 2021 11:34:47 +0000 Received: from localhost ([127.0.0.1]:48649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFat8-0001lS-Nh for submit@debbugs.gnu.org; Mon, 16 Aug 2021 07:34:46 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:46811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFat3-0001l9-8Q for 49996@debbugs.gnu.org; Mon, 16 Aug 2021 07:34:41 -0400 Received: by mail-wr1-f54.google.com with SMTP id f5so23053762wrm.13 for <49996@debbugs.gnu.org>; Mon, 16 Aug 2021 04:34:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pi2CjoU4r73Plf0bKEX69lqRSY9HiMRGS6lx3nSrNug=; b=PqAqAXkzPYt/lHSGxETU5n3ZVvBhUA1FkoGJTGJvE2QSlWqyMwht9Nk0E656FJkkdI luYKZmhcwYpWIklZUxtYcPArWzfiWpnIno+r3V2EeOm277CuMb9McYduvWd34/Hj3RXx mvb+e2DPjLcftnfrAEz4NwhQeHovjSBHNWHZy4mHWJj8KoTF6JH4Md9rloz2C1oZmAfG AzcPSkwktH2O0uVEJC0Z6DiYxxsC6h1bsmaIb28g/nQr/58OvSsmsnS1r/4c1lZcPCCn rmzq227wEmObFKYLdjz9ZYE+9kYWqdyiZwVnTrRrX18CTeK5cxFAl41rwmOyZ9bChJer +6HA== X-Gm-Message-State: AOAM532YWFRJvfa6oVwj3pUkf/o1hj7tsOWRQQ7/akkWTQWEXn79tBP3 hu8+L5xEnv/wLas2cXVmtNjMhhK9V4oVeqYNk18= X-Google-Smtp-Source: ABdhPJxjyMkFGLaLXbqkcyov5omI/jZY6k38icRmUj5HctwdO+NXlsmMvHBOkzBlGJbS4VXM6Vw5KiiRE1m3tMW9hLw= X-Received: by 2002:a5d:6b92:: with SMTP id n18mr8923904wrx.343.1629113671379; Mon, 16 Aug 2021 04:34:31 -0700 (PDT) MIME-Version: 1.0 References: <87eeb0o37e.fsf@latte.josefsson.org> <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> <202108151425.17FEPpXw029025@freefriends.org> <864f7326-48cc-86ed-cbca-502ebded54f5@cs.ucla.edu> In-Reply-To: <864f7326-48cc-86ed-cbca-502ebded54f5@cs.ucla.edu> From: Jim Meyering Date: Mon, 16 Aug 2021 13:32:16 +0200 Message-ID: Subject: Re: bug#49996: egrep and fgrep? To: Paul Eggert Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 49996 Cc: 49996@debbugs.gnu.org, Simon Josefsson , Aharon Robbins X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On Sun, Aug 15, 2021 at 8:11 PM Paul Eggert wrote: > > On 8/15/21 7:25 AM, arnold@skeeve.com wrote: > > I'm willing to bet that the majority of grep/egrep/fgrep invocations > > come from the command line rather than from scripts. > > That's not true for me, as I almost always invoke 'grep' via a script or > shell function or Emacs. And I'm skeptical that it's true worldwide. > > I doubt whether we should remove egrep and fgrep immediately, as that'd > be a bit sudden. But it's a good time to take the next step. Proposed > patch attached. Thanks for writing that, Paul. The patch looks fine. The irony... that one of our own tests used fgrep! One nit in the commit log: > * src/egrep.sh: Issue a obsolescence warning. s/a/an/ From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 16 13:14:12 2021 Received: (at 49996-done) by debbugs.gnu.org; 16 Aug 2021 17:14:12 +0000 Received: from localhost ([127.0.0.1]:50873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFgBg-0001By-I4 for submit@debbugs.gnu.org; Mon, 16 Aug 2021 13:14:12 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:52152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFgBd-0001Bh-Jq for 49996-done@debbugs.gnu.org; Mon, 16 Aug 2021 13:14:10 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 95F7D1600AD; Mon, 16 Aug 2021 10:14:03 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9xHbAOsLHrT1; Mon, 16 Aug 2021 10:14:03 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EFFF31600BB; Mon, 16 Aug 2021 10:14:02 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id i9DPRaeqw7VE; Mon, 16 Aug 2021 10:14:02 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C3D921600AD; Mon, 16 Aug 2021 10:14:02 -0700 (PDT) Subject: Re: bug#49996: egrep and fgrep? To: Jim Meyering References: <87eeb0o37e.fsf@latte.josefsson.org> <0c146307-00a7-1b7d-24a4-5acc22d685bc@cs.ucla.edu> <202108151425.17FEPpXw029025@freefriends.org> <864f7326-48cc-86ed-cbca-502ebded54f5@cs.ucla.edu> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <9277086f-6280-28cd-53ac-0fb86e75fa2a@cs.ucla.edu> Date: Mon, 16 Aug 2021 10:14:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 49996-done Cc: 49996-done@debbugs.gnu.org, Simon Josefsson , Aharon Robbins X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) On 8/16/21 4:32 AM, Jim Meyering wrote: >> * src/egrep.sh: Issue a obsolescence warning. > > s/a/an/ Thanks, I fixed that and installed the result with a bug# in the commit message. Closing the bug report. From unknown Sun Jun 22 08:07:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Sep 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator