More 39 problems egrep warning

Since the upgrade, Every time I launch any terminal I get error “egrep: warning: egrep is obsolescent; using grep -E”

It appares first, the the prompt is displayed on the next line in any new terminal window

There are no references to egrep in either ,bashrc, .profile, or .zshrc

Why am I suddenly getting this message? I can’t see why invoking a terminal app would have anything to do with any kind of grep

How do I eliminate it?

On my system (F39 Silverblue), egrep is an alias. Only when I delete that alias do I see that warning from /usr/bin/egrep. The alias is defined in /etc/profile.d/colorgrep.sh.

What shell are you using? You mentioned both .bashrc and .zshrc

Assuming bash, does it appear again if you run bash inside the shell? If so, try bash -x to trace it.

Search in /etc for a file that uses egrep.
Likely something in /etc/profile.d I would suspect.

Anything that uses the egrep command directly will receive that warning. /usr/bin/egrep is a shell script as shown here.

# file /usr/bin/egrep
/usr/bin/egrep: a /usr/bin/sh script, ASCII text executable


# cat /usr/bin/egrep
#!/usr/bin/sh
cmd=${0##*/}
echo "$cmd: warning: $cmd is obsolescent; using grep -E" >&2
exec grep -E "$@"

so calling that command produces the message before actually calling grep.

I’m using zsh but a web search suggested looking in those other files, so I looked and didn;t find grep or egrep in any oy them.

I have made the edits that were suggested.

Thank you

zsh has a similar tracing feature. You can try zsh -x |& grep egrep

Yes, that one is super annoying, because it bugs the user without any hint on the root cause. If it was meant to be useful it should have included $PPID or $(pstree $PPID) in its output (or even higher up the dependency tree).

The alias egrep 'grep -E --color=auto', while being useful, is a double bummer, because it trains people to use egrep, and once they write that in their scripts it depends on the presence of the alias.

Thanks for this useful explanation