Why should all Unix implementations work just like Linux? What's so special about Linux? Why doesn't Linux work like BSD?
Why should all Unix implementations work just like Linux? What's so special about Linux? Why doesn't Linux work like BSD?
Just a random opinion. Others disagree and prefer the BSD way. Concrete reasons include code-base simplicity.
https://github.com/coreutils/coreutils/blob/master/src/yes.c
https://github.com/openbsd/src/blob/master/usr.bin/yes/yes.c
Take the example you provided, of yes(1). Most of the extra code relates to optimizations, and ensuring that the entire argv is echoed back rather than just the first argument. Because of this, even a very simple example like:
"yes hello world"
will behave differently on BSD vs GNU, with the GNU version likely being what users expect.
Lol why? Not everyone grew up on GNU.
> strictly superior
This isn't something you can quantify and say 'strictly superior' it's all just taste and opinions.
I didn't grow up on GNU either, but the GNU yes does everything I expect having used other unix systems.
> This isn't something you can quantify and say 'strictly superior' it's all just taste and opinions.
For a complicated tool, sure. But this tool is very simple. The GNU yes(1) accepts 100% of inputs that work on the BSD tool. It does a few additional things too.
Extra functionality is always better?
Then I can fork GNU, add extra junk options, and give you a strictly superior tool? Nonsense.
The GNU tools are the Homer Cars of UNIX. Not everyone wants that.
Here's the thing: GNU userland isn't some poorly designed aberration. It's by far the most popular unix userland in the world and is very commonly ported to systems which may do things differently. Almost every other unix has a distro to supply GNU userland tools on it -- no other unix userland can make the same claim.
Not everyone wants it, sure. Especially people with perspectives broader than the typical user. Of course. But it's the most popular system in the world -- not some weird never-used prototype.
And in the case of yes(1), I think you would have to try very hard to find a reason for a user of the tool to have a negative preference.
You likely can't, all the possible option flags already have some meaning. <:)
Not sure what you mean - you can get it to print whatever you want by passing that on the command line?
puts(argv[1]);