Post AUquGSsxT116vbYcLo by lanodan@queer.hacktivis.me
(DIR) More posts by lanodan@queer.hacktivis.me
(DIR) Post #AUqrwEV12qgYbtaEZU by cks@mastodon.social
2023-04-20T17:43:22Z
5 likes, 4 repeats
So Fedora 38 has chosen to break fgrep and egrep, to the fun of everyone who has them in scripts, especially scripts in crontab entries.$ fgrep fred /dev/nullfgrep: warning: fgrep is obsolescent; using grep -FAdding output to standard error is an *incompatible change*. And this is happening only because the GNU Grep people are <redacted because I cannot think of quite the right phrase>.
(DIR) Post #AUqrwFHw6xoj3cTIp6 by cks@mastodon.social
2023-04-20T18:00:43Z
1 likes, 0 repeats
I have filed a Fedora 38 bug over this fgrep/egrep change and we'll see if it goes anywhere. I did my best to keep my system administrator's voice down, but I did not entirely succeed in hiding my views.https://bugzilla.redhat.com/show_bug.cgi?id=2188430
(DIR) Post #AUqt3IQSwbKqlmO3yC by lanodan@queer.hacktivis.me
2023-04-20T18:46:34.671949Z
0 likes, 0 repeats
@cks That deprecation step makes no sense as would still break so many things, might as well have just removed the commands (even if IMHO that’s the wrong direction, checking argv[0] is nothing, specially compared to all the stuff GNU does).
(DIR) Post #AUquGSFFqdG2wSyuSu by cks@mastodon.social
2023-04-20T18:57:47Z
0 likes, 0 repeats
@lanodan They don't even check argv[0]; for years egrep and fgrep have just been cover scripts.
(DIR) Post #AUquGSsxT116vbYcLo by lanodan@queer.hacktivis.me
2023-04-20T19:00:47.512068Z
0 likes, 0 repeats
@cks I guess maintenance-free code is somehow hard…
(DIR) Post #AUquMxDPc8EujSDd2m by cks@mastodon.social
2023-04-20T18:59:59Z
0 likes, 1 repeats
One of my opinions on egrep/fgrep versus 'grep -E' and 'grep -F' is that the former are rather nicer to type than the latter, and that matters. One extra letter, all lower case, no shifting needed. And egrep and fgrep have been there for a very long time.
(DIR) Post #AUquesd1PHrTibkGhs by lanodan@queer.hacktivis.me
2023-04-20T19:05:12.400655Z
1 likes, 0 repeats
@cks Mine is more that they can be different simple implementations, like fgrep done in an efficient way is probably going to have a completely different kind of algorithm than (e)grep.And I think I would intuitively pick something like pcregrep over grep -P
(DIR) Post #AUqx6UhIAwapVw2PPU by tusooa@kazv.moe
2023-04-20T19:32:55.094883Z
1 likes, 0 repeats
@lanodan @cks or just perl -ne '/xxx/ and print'
(DIR) Post #AUr7W2b8GnE5R6ydX6 by cks@mastodon.social
2023-04-20T21:26:36Z
1 likes, 0 repeats
@phasorburn Crontabs are potentially going to explode (no stderr to some stderr produces email), and people are generally not happy about extraneous output from scripts.(Fedora did not audit and remove egrep and fgrep usage from scripts they ship as part of packages; there are plenty in /usr/bin and even /usr/sbin that still use either/both.)
(DIR) Post #AUrBURGRzP0bAvnKm8 by cks@mastodon.social
2023-04-20T22:08:11Z
0 likes, 1 repeats
Unsurprisingly, usage of egrep and fgrep is common across the shell scripts (and probably other things) that are shipped by assorted open source packages. GNU Grep's decision to loudly deprecate and then remove these names is a giant and pointless middle finger to the general free/open source ecology, one that will require hundreds of projects to undertake pointless work just because GNU Grep people want to get rid of 'redundant' commands that have been there since, oh, V7 Unix in the 70s.
(DIR) Post #AUrDHLDLN87eYTDwYq by john@liberdon.com
2023-04-20T22:34:17Z
0 likes, 0 repeats
@lanodan @cks Are we sure this change happened recently? I started seeing that message when I first transfered from HP-UX (where there was no -E on grep, at least at the time) to Linux a long, long time ago.
(DIR) Post #AUrDlLaMYXiOOUIafo by lanodan@queer.hacktivis.me
2023-04-20T22:39:11.758470Z
0 likes, 0 repeats
@john @cks Could be that GNU is repeating itself or that you were using a different grep doing the same thing. (Linux kernel has no grep)
(DIR) Post #AUrELOX74g75xcy3P6 by lanodan@queer.hacktivis.me
2023-04-20T22:45:47.014332Z
0 likes, 0 repeats
@ellenor @john @cks Nah, POSIX_ME_HARDER
(DIR) Post #AUrGIyMRbuWk7PwyJM by cks@mastodon.social
2023-04-20T23:08:06Z
0 likes, 0 repeats
@john @lanodan There is definitely a specific change in GNU Grep 3.8 to now emit this deprecation warning: https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.htmlIt's possible that the GNU Grep people tried this before and got shot down back then.
(DIR) Post #AUrKEK7Zg9eryX28sC by john@liberdon.com
2023-04-20T23:52:09Z
0 likes, 0 repeats
@lanodan @cks Yeah I could've been using a different grep or that my memory is failing. Backing up what you're saying, I see this in the NEWS file for 3.8:> 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.The man pages have been mentioning the deprecation for ages. Maybe that's what I was thinking of.
(DIR) Post #AUrKJeou9GOlcTqPE8 by john@liberdon.com
2023-04-20T23:53:08Z
0 likes, 0 repeats
@lanodan export POSIXLY_HARD=1
(DIR) Post #AUrLGBndgmfshSA8aO by lanodan@queer.hacktivis.me
2023-04-21T00:02:07.222353Z
0 likes, 0 repeats
@john I guess that's something like Solaris.
(DIR) Post #AUrZdov9nmgu3DqDjM by sarvo@novoa.nagoya
2023-04-21T02:44:51.775Z
0 likes, 0 repeats
@cks@mastodon.social quit using enterprise linux and use a real distro.
(DIR) Post #AUtBjNUufHRc9XbRJo by john@liberdon.com
2023-04-21T21:26:21Z
0 likes, 0 repeats
@lanodan I was joking about POSIXLY_CORRECTSolaris never struck me as all that bad. Not as bad as HP-UX, IMO. But it's personal preference mostly.
(DIR) Post #AV3QNjjyj7w5f1O5tg by cks@mastodon.social
2023-04-26T18:01:28Z
0 likes, 0 repeats
Fedora has not accepted the fgrep/egrep bug report and says to take it upstream; Fedora doesn't patch upstream, so they say.The GNU Grep upstream is actively hostile to reverting this user-hostile change.This rejection leaves Fedora with a collection of packages with broken or malfunctioning scripts. Some of those upstreams will not change, and Fedora likely will not patch them to work again.Nice work, Fedora. Nice work, GNU Grep. This is the inevitable consequence of your decisions.
(DIR) Post #AV3QNkUlv9Mm09HSpk by penguin42@mastodon.org.uk
2023-04-26T19:57:34Z
0 likes, 0 repeats
@cks Would it actually need a patch? Couldn't you do it with a compat RPM that just replaced egrep and fgrep by shell scripts that did grep -E/-F ?
(DIR) Post #AV3QNlfnXdmRedRmeu by cks@mastodon.social
2023-04-26T18:03:30Z
0 likes, 0 repeats
Also, Red Hat will almost inevitably reverse this GNU Grep change in the next version of Red Hat Enterprise Linux when it branches from Fedora. If they don't, they will get laughed out of the room by enterprise developers and system administrators, who are not going to change decades of scripts (or accept broken packaged ones from RHEL) because GNU Grep had a fit of narrow POSIX compliance.
(DIR) Post #AV3T6gww9NMZwb0qtE by cks@mastodon.social
2023-04-26T20:27:09Z
0 likes, 0 repeats
@penguin42 You could do it that way but then you'd have to change the main grep RPM to not package their (broken) egrep/fgrep scripts (and to require the compat RPM).
(DIR) Post #AV3TN1A2lx9zGIvbou by penguin42@mastodon.org.uk
2023-04-26T20:31:06Z
0 likes, 0 repeats
@cks I thought there was an rpm feature to overwrite stuff from another rpm? anyway, if not I was thinking 'alternatives' could be used.
(DIR) Post #AV3U4GSrkYDfB3LzsG by cks@mastodon.social
2023-04-26T20:38:18Z
0 likes, 0 repeats
@penguin42 Two RPMs can provide exactly the same file (ie, same contents), but it's an RPM error to have clashing file contents in the same name. There's also sadly no mechanism for one RPM to make another RPM's file into an alternatives thing; all RPMs involved have to buy into it (and then none provide the actual file). So everything would take RPM packaging changes for GNU Grep in some form.
(DIR) Post #AV3Y2moctl6wkX5Bk8 by xtaran@chaos.social
2023-04-26T21:00:44Z
0 likes, 0 repeats
@cks: Debian reverted that horrible grep upstream change several months ago already and IIRC intents to keep it that way forever.
(DIR) Post #AV3Y2nXIDgq8z3yrMe by cks@mastodon.social
2023-04-26T21:19:28Z
1 likes, 0 repeats
@xtaran Yeah, Fedora is the first semi-major distribution I've heard of that has taken this change and not reverted it. Everyone else seems to have noped out.
(DIR) Post #AV3cByiyOHQI6h4pn6 by penguin42@mastodon.org.uk
2023-04-26T22:09:54Z
0 likes, 0 repeats
@cks I guess you could try the rpm packaging change with Fedora; if you also provided the alternate; then there's no upstream change so that feels less objectionable.
(DIR) Post #AV7XF27EW3FYM4twoq by JdeBP@tty0.social
2023-04-28T19:33:18Z
0 likes, 0 repeats
@penguin42 @cks That's the thing. The GNU egrep and fgrep _already are_ shell scripts. Paul Eggert added this change _to those shell scripts_.https://debbugs.gnu.org/cgi/bugreport.cgi?msg=17;att=1;bug=49996;filename=0001-egrep-fgrep-now-obsolete.patch#GNU #grep #egrep #fgrep