Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 869788 - /bin/egrep from sys-apps/grep-3.8 issues a warning that egrep is "obsolescent"/obsolete
Summary: /bin/egrep from sys-apps/grep-3.8 issues a warning that egrep is "obsolescent...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-11 22:35 UTC by John Bowler
Modified: 2022-09-11 23:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Bowler 2022-09-11 22:35:30 UTC
As of sys-apps/grep-3.8 the installed program /bin/egrep now issues a warning, literally:

egrep: warning: egrep is obsolescent; using /bin/grep -E

if run from a shell script, e.g. this one:

#!/bin/sh
egrep "$@"

IT DOES NOT DO THIS WHEN RUN FROM THE COMMAND LINE (try both).

This is the dumbest thing since the chocolate teapot, but presumably given that it comes from the gods, it (doing it in one place not the other) won't change.  The only fix is to find any shell scripts that use it (and, presumably, programs using system()) and change them.

Not a gentoo bug, I entered it solely with the aim of helping people who are wondering what has happened.
Comment 1 Mike Gilbert gentoo-dev 2022-09-11 23:03:11 UTC
(In reply to John Bowler from comment #0)
> As of sys-apps/grep-3.8 the installed program /bin/egrep now issues a warning

This is expected, and is mentioned in the NEWS file for this release.

> IT DOES NOT DO THIS WHEN RUN FROM THE COMMAND LINE (try both).

Your interactive shell probably has an alias defined.

The app-shells/bash package installs /etc/bash/bashrc, which does the following:

> alias grep='grep --colour=auto'
> alias egrep='grep -E --colour=auto'
> alias fgrep='grep -F --colour=auto'
Comment 2 Larry the Git Cow gentoo-dev 2022-09-11 23:13:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04add5d9bfe8a7b790ad8564e11f7c5bd7846139

commit 04add5d9bfe8a7b790ad8564e11f7c5bd7846139
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-09-11 23:10:25 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-09-11 23:10:25 +0000

    app-shells/bash: remove egrep/fgrep aliases from bashrc
    
    Upstream has declared these forms to be deprecated. Aliasing them to
    'grep -E' and 'grep -F' prevents the deprecation warning from being
    displayed, which could lead to confusion.
    
    Bug: https://bugs.gentoo.org/869788
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 app-shells/bash/files/bashrc | 2 --
 1 file changed, 2 deletions(-)
Comment 3 John Bowler 2022-09-11 23:49:25 UTC
Indeed you are correct. "type egrep".

I'm an ancient UNIX programmer, I don't expect the world to be changed under my feet (I've never used grep, it's dumb).  Oh well...