4 ms·
The differences between GNU and UNIX behavior can be substantial. I used a SunOS system for a few terms in college; I used Debian to get work done, but for a f
by JoshTriplett 11y ago
The differences between GNU and UNIX behavior can be substantial. I used a SunOS system for a few terms in college; I used Debian to get work done, but for a few things we had to make sure our code compiled and ran on the SunOS system.
One of the first things I noticed in the short while before I put the GNU tools at the front of my path: the SunOS tools wanted all options before all other arguments. So if you have "ls something", and you hit up, space, -l, enter, (or "!! -l" if you prefer) then instead of the long listing you expected, you get the same short listing as before, along with an error like "-l, no such file or directory".
It's minor, but it's one of those things that adds up when you're used to more capable tools and find yourself in a less capable environment.
OpenBSD doesn't necessarily suffer from the same deficiencies (I certainly don't know if they have that one or not), but when you're used to coreutils, any other tools can be a shock, and not typically in a good way. The same goes for environments like busybox, but at least there it's for a good reason: size constraints.
I'd be curious to hear examples where the reverse is true: are there instances of the standard command-line tools available on other UNIXen being substantially better than the GNU userspace tools?
- justincormack 11y agoifconfig works in the BSDs and can control all kinds of interfaces, rather than being a broken deprecated tool. Obviously that is not entirely comparable as there is ip. Generally i dont notice much difference - you are comparing to old Unixes like SunOS that had very limited commands. AIX is like that too.
- ams6110 11y agoAlso, most if not all the gnu variants of common utilities are in ports if you need them.
- justincormack 11y agoI have to admit to never having installed any extra GNU stuff except gmake in a BSD, everything else just works...
- woodman 11y agoThat depends on how you define "substantially" and "better". Consider cat.c from gnu [0] and openbsd [1]. I'd say that openbsd's implementation is "substantially better", because: 1. it does everything I need in 194 LOC (vs 488 LOC) 2. the code is so understandable that it needs no commenting (and I'm not just saying that because it has no comments, it is braindead simple code) 3. there are no ifdefs and the program state is much more shallow Now obviously that is from the perspective of a programmer, but it has been my experience that if the code base sucks for programmers - then things suck for the users as well (surprising behavior, security issues, long lag in bug fix, etc). I once spent a day chasing a bug related to autotools and colorized output from grep... sometimes the bells and whistles get in the way of actually getting things done. [0] http://git.savannah.gnu.org/cgit/coreutils.git/plain/src/cat.c http://git.savannah.gnu.org/cgit/coreutils.git/plain/src/cat... [1] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/cat/cat.c?rev=1.21&content-type=text/x-cvsweb-markup http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/cat/cat.c?r...
- JoshTriplett 11y agoWhile I appreciate the value of a cleaner or simpler codebase, I can't place as much value on that as I do on usability, unless the code is utterly unmaintainable beyond all hope of redemption. And whatever you might think of the extra complexity of the GNU code, for good or ill, it certainly isn't that.
- woodman 11y agoAgain, a lot of words with definitions that intelligent people can disagree on. This is why there are so many different operating systems... and implementations of echo.c. So to answer your original question more directly : yes, there are many instances of the standard command-line tools available on other UNIXen being substantially better than the GNU userspace tools. In my opinion. You may disagree, but who is to say?
- deleted 11y ago[deleted]
- Freaky 11y agobsdtar's really nice. It's more a tar-flavour wrapper around libarchive, and thus has support for many formats: Read: tar, pax, cpio, zip, xar, lha, ar, cab, mtree, rar, and ISO images. Write: tar, pax, cpio, zip, xar, ar, ISO, mtree, and shar. I believe it had tar compression detection significantly earlier than GNU tar too.
- JoshTriplett 11y agoInteresting example, thanks! There are generic tools like "unar", but it's interesting that in the BSD world tar grew those features instead. An odd counterpoint to the accusations of "bloat" often leveled at GNU.
- Freaky 11y agoThe other interpretation is that instead of reinventing the wheel purely for tar, it's all been factored out into a standardised library anything can use for generic archiving tasks. e.g. instead of: 440K gtar 151K gcpio 144K unzip Base has: 655K libarchive.so.6 57K bsdtar 37K bsdcpio 20K unzip 34K bigger, much wider format support, and directly usable by other tools like pkg and ar, as well as third party apps like tarsnap and cmake.