3 ms·
I agree with the author that this could just be a fatal error and not an obsolescence warning; the obsolescence warning has been in the spec for thirty years al
by kazinator 3y ago
I agree with the author that this could just be a fatal error and not an obsolescence warning; the obsolescence warning has been in the spec for thirty years already.
I learned about a quarter century ago that egrep and fgrep are considered obsolescent by POSIX/SuS, which has grep -E and grep -F, and stopped using them.
Here is Single Unix Spec from 1997:
https://pubs.opengroup.org/onlinepubs/007908799/xcu/egrep.html https://pubs.opengroup.org/onlinepubs/007908799/xcu/egrep.ht...
That's probably before some of the complainers were weaned off diapers.
However, I disagree with the removal of these commands. A POSIX or "Unix-like" system has a good many commands that are not in the spec. Removing commands that are in the spec (or have been) but were obsolescent is completely wrongheaded.
A sane approach might be for the utilities project like Coreutils to remove the programs; distros can simulate them with scripts (that don't emit any lame chatter):
This could be /usr/bin/egrep:
#!/bin/sh
grep -E "$@"
Why should we remove egrep just because it was mentioned in the spec as obsolescent, yet keep emacs or ssh that are not in the spec?
It should be a priority to retain any command that was ever in the actual spec, regardless of whether it was obsolescent, over retaining commands that are not in the spec.
The guiding principle should be whether those commands are in wide use and whether they are harmful in any way. fgrep and egrep aren't harmful. There is a spec for them which says what they should do; we have it from POSIX that egrep is equivalent to grep -E. People use them.
The only portability issue with egrep in a script is that it might not be there, which would only be because someone had a knee-jerk reaction to wording in the spec. If a system does have egrep, it is expected to conform to the spec and be equivalent to grep -E.
- f33d5173 3y agoI learned at one point that posix doesn't include tar, and instead has an archiving tool called "pax". I haven't seen references to pax outside of this discovery, and indeed many systems don't even include pax. If posix can't even include such a prototypically unix tool as tar, then how can it claim to standardize the open variant of unix systems?
- kazinator 3y agoI think the issue is that they tried, but couldn't, due to differences in tar. So they came up with pax. This is because they wanted a format that is interoperable among implementations. However, I think there are two mistakes in the process: 1. Why should it matter that there are different flavors of tar out there which have interoperability issues? The command and some of its options could be standardized, as having an implementation-defined format. The ecosystem of POSIX-like systems will solve the interoperability problem. 2. Why consider the matter closed for so many decades; maybe the issue should be revisited? There should be an effort to have tar as a standard command, given that it's widely used. The only reason we have POSIX in the first place is that Unix is widely implemented and used. I mean, different file systems have totally different inode data structures, right? Yet we have a standard commands that manipulate things in the file system, like ls. What your system can ls, another one might not be able to mount at all.