Live data from Hacker News

We are stuck with egrep and fgrep (unless you like beating people)

utcc.utoronto.ca

21–30 of 354 posts

Re: We are stuck with egrep and fgrep (unless you like beating people)

#21

> The egrep and fgrep commands have been deprecated since 2007. Isn't 15 years more than enough time to handle the deprecation?

Sure now that I’ve finished rebuilding all my dependencies to use 64-but time_t and migrated all my services to IPv6 I can finally take some time to finish the great *grep deprecation :)

I’m just joking :)

Re: We are stuck with egrep and fgrep (unless you like beating people)

#23
post #12
post #2

What problem is this warning trying to solve? Are these two symlinks too much maintenance burden? Or is the check in the code hurting the code quality? Is the extra check at startup ruining performance? I'm usually in favour of having one way to do things but in this case, with this much legacy it just doesn't seem worth it.

This is free software. It is legitimate to consider convenience for the maintainers. If they don't want to maintain two symlinks then they are empowered to make that call. If anyone thinks it is a big enough problem that they want to fork the software they can, or the distros can maintain their own symlinks. But I think in this case the simple answer is if the maintainer doesn't want it in the source tarball then it…

> It is legitimate to consider convenience for the maintainers.

Yes, but the convenience of... creating 2 symlinks and adding the flag based on argv[0]?

Sorry, I don't buy it. Wanting to die on such a tiny hill has GNU written all over it though

Re: We are stuck with egrep and fgrep (unless you like beating people)

#25

Earlier quoted context omitted.

It's more than likely the warning will be printed to stderr, not out, so there will be no impact on the actual work done.

Automatically monitoring the stderr from cron jobs for unusual outputs is a prudent measure, and its plausible that this change will increase the burden of false positives (it certainly will not reduce it.)

But if you’re monitoring the output it usually means you are in a position to fix problems which means you can likely update the script in question to use the new warning-less invocation.

Re: We are stuck with egrep and fgrep (unless you like beating people)

#26
post #12
post #2

What problem is this warning trying to solve? Are these two symlinks too much maintenance burden? Or is the check in the code hurting the code quality? Is the extra check at startup ruining performance? I'm usually in favour of having one way to do things but in this case, with this much legacy it just doesn't seem worth it.

This is free software. It is legitimate to consider convenience for the maintainers. If they don't want to maintain two symlinks then they are empowered to make that call. If anyone thinks it is a big enough problem that they want to fork the software they can, or the distros can maintain their own symlinks. But I think in this case the simple answer is if the maintainer doesn't want it in the source tarball then it…

I don't know when society in general just said "Fuck It" to the idea of stewardship; but we now have it ingrained that people in positions of trust and power (whether volunteered, elected or appointed) are not morally or ethically beholden or responsible to the communities they have taken it upon themselves to represent.

At least we used to pay lip service to that ideal.

Re: We are stuck with egrep and fgrep (unless you like beating people)

#27
post #9

Earlier quoted context omitted.

the issue is that programs rely on the existence of fgrep in its PATH. your shell alias doesn't fix that.

#!/bin/sh exec grep -E "$@"

Of course it can be solved; no one claimed you can't. The choice here is:

- Thousands of users have to update their scripts, habits, shell configs; or

- The GNU Grep maintainers spend essentially zero minutes "maintaining" a few lines of code to automatically use -E or -F based on argv[0].

It seems to me the second is obviously the better option.

Re: We are stuck with egrep and fgrep (unless you like beating people)

#28
post #10

Earlier quoted context omitted.

It seems pretty simple, piping bash commands into other bash commands and other text stream juggling is a pretty typical use of these commands and so changing what stream is output can change the behavior of consumers of the output of these functions. I haven’t done anything with fgrep and egrep before but piping grep into another grep for more complex classes of text search is something i use a lot.

It's more than likely the warning will be printed to stderr, not out, so there will be no impact on the actual work done.

It's not unusual in shell scripts to combine stderr with stdout by using "2>&1" or similar.

Re: We are stuck with egrep and fgrep (unless you like beating people)

#29
post #12

Earlier quoted context omitted.

This is free software. It is legitimate to consider convenience for the maintainers. If they don't want to maintain two symlinks then they are empowered to make that call. If anyone thinks it is a big enough problem that they want to fork the software they can, or the distros can maintain their own symlinks. But I think in this case the simple answer is if the maintainer doesn't want it in the source tarball then it…

I don't know when society in general just said "Fuck It" to the idea of stewardship; but we now have it ingrained that people in positions of trust and power (whether volunteered, elected or appointed) are not morally or ethically beholden or responsible to the communities they have taken it upon themselves to represent. At least we used to pay lip service to that ideal.

They didn't necessarily "choose communities to represent". As the maintainer and author of various open source libraries and tools that are used by many thousands, in most cases it's just that ... I'm one of the few willing to spend the time on it, and it's usually useful for myself as well. I don't really "represent" any community or anyone.

That said, I certainly wouldn't have put in this change myself, because I wouldn't like to inconvenience anyone. But that's just basic good manners that you should have in every-day life to random strangers.

Re: We are stuck with egrep and fgrep (unless you like beating people)

#30

> The egrep and fgrep commands have been deprecated since 2007. Isn't 15 years more than enough time to handle the deprecation?

Not when the command in question has been a standard part of all Unix shell environments since 1977, no. Is that a serious question?

https://medium.com/@rualthanzauva/grep-was-a-private-command...

What actually happened here is that POSIX skipped it. It never entered a standard, even though it was (literally!) in every OS and available to everyone. But no one cared that it wasn't in some arbitrary standard, because it was always there. For half a century!

I dare say that "fgrep" and "egrep" have more active users (both interactive and scripted) than "awk" or "ed" or "od" or "bc", all of which are still around.

Post reply on HN