by yjftsjthsd-h · 3y ago · 0 comments
Oh how times have changed:) But even with the demise of most commercial unixen, I was under the impression that Darwin preserved the ancient tradition of installing the system and then immediately replacing its coreutils with GNU?
sed -i '' 's/foo/bar/g' # BSD sed
sed -i 's/foo/bar/g' # GNU sedAn interesting factoid is that FreeBSD/macos sort(1) was using GNU code until recently, since this is quite tricky to implement. Eventually it was reimplemented for GPL avoidance reasons.
We do consider macos though, and ensure all tests pass on macos for each release
As a Unix graybeard I always place options first. Options last feels like Windows command prompt, so nothing I want to see...
I always tell younger colleagues who place options in the end, it might work with some commands, but just don't do it. I did not know that "some" includes all of GNU coreutils? A single common code style is a virtue, even in interactive use if there are onlookers. So I guess I will continue to point it out.
(Thus continuing and extremely long tradition of layering GNU over the vendor tools; ex. Sun had their own tools, but everyone liked the GNU versions better.)
Possibly the same type of people that target bash specifically in shell scripts I guess.
For example, I managed to create a surprisingly good test suite with bash and the rest of the GNU coreutils:
https://github.com/lone-lang/lone/blob/master/scripts/test.b...
It even runs in parallel. Submitted a patch to coreutils to implement the one thing it couldn't test, namely the argv[0] of programs. I should probably go check if they merged it...