Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egrep warning #641

Open
MmeOokamy opened this issue Oct 14, 2022 · 3 comments
Open

egrep warning #641

MmeOokamy opened this issue Oct 14, 2022 · 3 comments
Assignees

Comments

@MmeOokamy
Copy link

Hello everybody,

My OS : ManjaroLinux 22.0.0
today I updated grep.
after reboot of the system I met an error during the commands git ftp init / push:

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

I'm not sure if this is the right solution but in my file /bin/git-ftp, I replaced all occurrences of egrep by grep -E
now i don't have any error with git ftp.

is it the right thing to do or not?

@alfiosalanitri
Copy link

same warning with Arch Linux

@Vinze
Copy link

Vinze commented Nov 4, 2024

I'm guessing more and more people will get this warning as distros upgrade their grep version.

Will replacing egrep with grep -E break older systems? If not this seems like an easy fix.

@LukasFritzeDev
Copy link
Collaborator

Looks like this change was introduced in GNU grep version 3.8, released in September 2022.

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.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

The -E flag has been supported by grep since its early versions, as it is part of the POSIX standard. Specifically:

  • grep -E was included in POSIX.2, which was ratified in 1992.
  • Any reasonably modern version of grep (even pre-GNU versions) supports -E.

Thus, using grep -E instead of egrep should be safe and backward-compatible change for almost all versions of grep in use.

@LukasFritzeDev LukasFritzeDev self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants