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: egrep is obsolescent; using grep -E #1338

Open
Obema12 opened this issue Sep 27, 2022 · 19 comments
Open

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

Obema12 opened this issue Sep 27, 2022 · 19 comments
Assignees

Comments

@Obema12
Copy link

Obema12 commented Sep 27, 2022

The execution of lynis audit system is accompanied by a whole bunch of messages related to grep

egrep: warning: egrep is obsolescent; using grep -E
  - Total without nodev:8 noexec:13 nosuid:6 ro or noexec (W^X): 13 of total 27
  - Disable kernel support of some filesystems
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E

Fix it at last.

@mboelen
Copy link
Member

mboelen commented Sep 27, 2022

On what operating system and version are you running Lynis?

@mboelen mboelen self-assigned this Sep 27, 2022
@Obema12
Copy link
Author

Obema12 commented Sep 27, 2022

Archlinux.

@konstruktoid
Copy link
Contributor

man grep(1) on Ubuntu 20.04.5:
"the variant programs egrep, fgrep and rgrep are the same as grep -E, grep -F, and grep -r, respectively. These variants are deprecated, but are provided for backward compatibility."

@mboelen
Copy link
Member

mboelen commented Sep 27, 2022

Looks like we have some conversion to do. The reason to use egrep was that grep on Solaris did not support the -E flag. A shame that the command is spewing messages now and therefore breaking that backward compatibility.

@Obema12 Thanks for your feedback. Next time when you report an issue, please leave off the "Fix it at last." at the end of your issue. It sounds unfriendly, while it may or may not be intended.

@konstruktoid
Copy link
Contributor

Just to clarify; egrep, fgrep or rgrep don't spew any messages regarding deprecation on Ubuntu.

@mboelen
Copy link
Member

mboelen commented Sep 27, 2022

Yup. Looks like someone decided to turn on this message in a recent version of the package that contains the related utilities. Similar messages show up, most of them are from this month. With Arch Linux using often the newest packages it is no surprise it pops up there first. So it definitely makes sense to convert now that the compatibility starts to break.

@Obema12
Copy link
Author

Obema12 commented Sep 27, 2022

@mboelen tried to be polite. But dozens of problems found and sent show that politeness does not achieve anything.

I sent rougher questions and it got a much faster developer response. It got to the point that rudeness, published immediately after politeness, was decided immediately! Whereas the polite message remained open for months.

I don't know how it works.

@mboelen
Copy link
Member

mboelen commented Sep 27, 2022

So it was intended. In that case, let me be very clear: we have a Code of Conduct (listed here on GitHub, including under the comment form "Remember, contributions to this repository...").

The CoC states that we expect people to be welcoming and friendly within this community, and also my duties as a project owner. It would be nice to treat people how you want to be treated yourself.

If you can't (or won't like to) accept these rules within the CoC, please don't be part of our community.

@ghost
Copy link

ghost commented Nov 16, 2022

There are countless executeables that behave differently according to how they are named. This whole deprecated thing is developers who can't find something useful to do. 30+ years of scripts with egrep and fgrep. If Linux folks keep this stuff up it will eventually be as nasty as Wyndoze.
If It Ain't Broke, Don't "Fix" it. Pure pedantry.

@ghost
Copy link

ghost commented Nov 16, 2022

I guess I can set up a shell alias. :|

@webcaptcha
Copy link

@fw-ops-automation-imprivata were you success in writing that alias? I am looking for workaround too.

@OckhamOdyssey
Copy link

@webcaptcha I tried right now. I add the alias in the bashrc, zshrc, root bashrc and root zshrc. Nothing worked :/

@mlude
Copy link

mlude commented Jan 16, 2023

the warning message was introduced in gnu grep 3.8

@jokeyrhyme
Copy link

The reason to use egrep was that grep on Solaris did not support the -E flag.

Could we do a one-time test at the very beginning that checks whether grep -E works, and if it does not then fallback to egrep ?

@konstruktoid
Copy link
Contributor

agreed @jokeyrhyme and then replace `${EGREPBINARY} with a working command, so it doesn't need such a big rewrite.

@XenGi
Copy link

XenGi commented Apr 12, 2023

I added a EGREPBINARY var to my pull request. Let me know over there if this is a good approach.

@xnoguer xnoguer mentioned this issue Apr 23, 2023
@wileyhy
Copy link

wileyhy commented Jun 22, 2023

This bug is still an issue.

** # lynis --version
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
3.0.8

@wileyhy
Copy link

wileyhy commented Jun 23, 2023

egrep isn't POSIX any more, as it happens.

The Open Group Base Specifications Issue 7, 2018 edition
IEEE Std 1003.1-2017
...
C.4.2 Utilities Removed in the Previous Version
The following utilities were removed in the previous version of this standard:
...egrep fgrep..

https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html

@xnoguer
Copy link
Contributor

xnoguer commented Sep 19, 2023

@mboelen This issue can probably be closed now after these commits:
e816df5
1dad487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants