4 ms·
It’s a matter of principle. If you wrote a script yesterday (or a year ago) and didn’t include that line, you need to re-release it today. That’s stupid. Also,
by ComputerGuru 4y ago
It’s a matter of principle. If you wrote a script yesterday (or a year ago) and didn’t include that line, you need to re-release it today. That’s stupid.
Also, you’re being very sanctimonious about this but what if you didn’t see this HN story. Would you know to do that for the next script you distribute?
- koprulusector 4y agoFrankly I can count on two hands the number of times I’ve used egrep in my life (same for grep -E). As long as I can remember I’ve relied on sed, awk, or find -regex for filtering output with regex. I only say this because I can’t relate to those that are upset about the change. That said, to answer your questions directly: hopefully you aren’t auto updating anywhere in production or important, so this won’t effect anything until the box has grep 3.8. Ubuntu 20.04 uses grep 3.4, for example. And the warning prints to stderr, so honestly, I'm having a difficult time seeing this being an actual problem for more than 0.1% of users. I’m not unsympathetic to those that it adversely affects, but I genuinely haven’t seen anyone point out any severe consequences of the change. I’m not saying it’s impossible, if someone has a real example (sorry, saying you might get a page on the weekend for a warning printed to stderr is a stretch), I’m all ears.
- ur-whale 4y ago> Frankly I can count on two hands Emphasis on "I", which says strictly nothing of the rest of CLI users out there. We're very glad to learn that it is not a problem for you, but it brings very little to the conversation.
- robertlagrant 4y ago> We're very glad to learn that it is not a problem for you Worth reading the guidelines [0]. [0] https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- koprulusector 4y agoBut neither does this comment.. do you have an example to share in response to my questions above?
- strenholme 4y agoEveryone has their own story, and one’s person’s experience can be very different from another person’s experience. I used egrep a whole lot, dozens of times for the automated test setup I have for my open source project. I had to spend most of an hour this morning updating that code to no longer use egrep—a non-trivial task. Here’s the amount of hassle breaking egrep has given me: https://github.com/samboy/MaraDNS/commit/afc9d1800f3a641bdf1bf14d39802443a34c2b70 https://github.com/samboy/MaraDNS/commit/afc9d1800f3a641bdf1... This is just one open source project. I’ve seen fgrep in use for well over 25 years, back on the SunOS boxes we used at the time. egrep apparently has been around for a very long time too. Just because it didn’t get enshrined in a Posix document—OK, according to Paul Eggert it was made obsolete by Posix in 1992, but apparently no one got the telegram and it’s been a part of Linux since the beginning and is also a part of busybox—doesn’t mean it’s something which should be removed. I’m just glad I caught this thread and was able to “update” my code.
- deleted 4y ago[deleted]
- kazinator 4y agofgrep and egrep have been indicated as obsolescent by the Single Unix Specification and POSIX since the late 1980's. The man page for GNU grep says: In addition, 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. "Deprecated" should be read as "maybe ain't gonna be around one day". "Use interactively, or in your personal setup, but don't put into shipping code". So if you wrote a script yesterday with these things, you're just one of those people who don't look into specs or man pages. The scripts of coders who don't read documentation are going to tend not to be portable or reliable anyway. That doesn't mean we should break things left and right to trip people up, but in this case the writing has been on the wall for a very long time.