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

use grep -E instead of egrep #622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

use grep -E instead of egrep #622

wants to merge 1 commit into from

Conversation

lufia
Copy link
Contributor

@lufia lufia commented Jul 14, 2023

I noticed egrep always output warning:

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

I heared this warning may be introduced in GNU Grep v3.8.

@dancrossnyc
Copy link
Collaborator

Not all systems use GNU grep, however, and the world as a whole does not seem to be in a rush to get rid of egrep. I find the warnings annoying; some uses of egrep can probably just be replaced with grep (without the -E) which would, at least, cut down on the noise.

On the other hand, grep -E does seem to be in POSIX (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html) so it may be sufficiently portable, and POSIX does make a note about the intention to combine grep, egrep and fgrep into a single command. However, I am not sure that everything that plan9port supports has gotten the memo yet.

@lufia
Copy link
Contributor Author

lufia commented Oct 3, 2023

According to https://9fans.github.io/plan9port/

Linux (x86, x86-64, PowerPC, and ARM), FreeBSD (x86, x86-64), Mac OS X (x86, x86-64, and Power PC), NetBSD (x86 and PowerPC), OpenBSD (x86 and PowerPC), SunOS (x86-64 and Sparc), Dragonfly BSD (x86-64).

I checked grep supports -E option nowadays on several systems:

The -E option means to allow extended regexp in all implementations of grep(1).

@macie
Copy link

macie commented Feb 14, 2024

This PR fixes #587

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

Successfully merging this pull request may close these issues.

None yet

3 participants