You are not logged in.

#1 2022-09-10 21:11:21

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

[SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

After recent updates to grep, I am now seeing a warning line the first time I run a console window (such as konsole) in the plasma desktop after a reboot, which is the single line:

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

after that the terminal runs as normal.

Opening subsequent terminal windows does not give that warning. It is not a big issue, but I wondered if that is a bug, or whether a gentle nudge to stop using egrep if you haven't already!  Perhaps there is a way to switch that off even though it happens only once after a reboot!

Last edited by mcloaked (2022-09-10 21:30:46)


Mike C

Offline

#2 2022-09-10 21:12:56

loqs
Member
Registered: 2014-03-06
Posts: 17,440

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

Have you located what script is calling egrep?

Offline

#3 2022-09-10 21:17:40

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

No I haven't found anything obvious.  It just started happening after the grep update to 3.8 - there is no reference to that command in .bashrc so nothing obvious calling it!  It happens whether the first call is to konsole, or to qterminal - but once either has been opened then all subsequent new konsole or qterminal windows don't have that line! Maybe it is a new bug!


Mike C

Offline

#4 2022-09-10 21:21:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,561
Website

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

Your shellrc would not be relevant, but your profile(s) are.  Check ~/.bash_profile, /etc/profile, and any files included from them and perhaps check the bash man page to see if there are other files sourced for a login shell.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2022-09-10 21:26:05

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

OK I do call a file from my .bashrc which does contain egrep!  So I will change that - thank you.


Mike C

Offline

#6 2022-09-10 21:28:16

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

The warning is an upstream change...
https://www.phoronix.com/news/GNU-Grep- … grep-fgrep

As Trilby says the egrep command is being called somewhere in your login shell configs.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2022-09-10 21:33:26

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

Thank you, and yes I found one of my files that was called from .bashrc had a line that needed changing:

$ diff ssh-agent-start.sh ssh-agent-start.sh.prev 
33c33
<     eval "$agent |grep -E -v 'echo Agent pid' > $info"
---
>     eval "$agent |egrep -v 'echo Agent pid' > $info"

Making that change now fixes the issue (the file has been in place there for quite a few years - and I hadn't realised the egrep command was still there!  I was aware that egrep (and fgrep) are now obsolete!


Mike C

Offline

#8 2022-09-11 07:18:43

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

/usr/bin/xdg-open from the xdg-utils package generates the same warning.

Offline

#9 2022-09-11 12:54:39

tekstryder
Member
Registered: 2013-02-14
Posts: 133

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

tucuxi wrote:

/usr/bin/xdg-open from the xdg-utils package generates the same warning.

https://gitlab.freedesktop.org/xdg/xdg- … equests/21
https://gitlab.freedesktop.org/xdg/xdg- … equests/44

Offline

#10 2022-09-20 07:27:48

r-giskard-reventlov
Member
Registered: 2020-03-25
Posts: 5

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

virtualenvwrapper seems to be another source:

$ cat /usr/bin/virtualenvwrapper.sh | grep egrep
if echo "$workon_home_dir" | (unset GREP_OPTIONS; command \egrep '([\$~]|//)' >/dev/null)
    | (unset GREP_OPTIONS; command \egrep -v '^\*$') 2>/dev/null
pip freeze | egrep -v '(distribute|wsgiref|appdirs|packaging|pyparsing|six)' > "$req_file"

Offline

#11 2022-09-20 12:31:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,561
Website

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

We don't need a pile of "this too" posts here as they serve no purpose.  If you find a package-provided script that uses egrep, please open a bug report / feature request on the bug tracker where the relevant people will actually see it.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2022-09-20 13:15:56

loqs
Member
Registered: 2014-03-06
Posts: 17,440

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

In the case of virtualenvwrapper https://bitbucket.org/virtualenvwrapper … equests/84 assuming the PR is merged within a few days,  followed by a new release I would wait for that.

Offline

#13 2022-10-12 19:54:25

lachesis
Member
Registered: 2012-07-17
Posts: 8

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

Wow that's a bad decision by upstream. These have literally been around since before I was born. Just leave them be and don't break scripts.

Offline

#14 2022-10-12 23:39:39

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: [SOLVED]egrep: warning: egrep is obsolescent; using grep -E in console

lachesis wrote:

Wow that's a bad decision by upstream. These have literally been around since before I was born. Just leave them be and don't break scripts.

Whether or not this is true (I'm ambivalent), the thread has been solved, and this isn't constructive contribution.

Closing.

All the best,

-HG

Offline

Board footer

Powered by FluxBB