9 ms·
> However, there are a number of operating systems, such as MacOS, that are fully compliant with the POSIX standard and can therefore be called Unix operating s
by Karellen 2y ago
> However, there are a number of operating systems, such as MacOS, that are fully compliant with the POSIX standard and can therefore be called Unix operating systems, not just Unix-like.
It's a bit more nuanced than this. Being fully compliant with the POSIX standard isn't quite enough; you have to pass an official conformance test suite and be certified by the Open Group to have passed it, in order to call yourself "Unix", rather than just being Unix-like.
https://en.wikipedia.org/wiki/Single_UNIX_Specification https://en.wikipedia.org/wiki/Single_UNIX_Specification
So there could be (and likely are) implementations out there which are fully compliant with the standard, but have not chosen to get certified, and are therefore technically still "not Unix".
- skissane 2y ago> Being fully compliant with the POSIX standard isn't quite enough; you have to pass an official conformance test suite and be certified by the Open Group to have passed it, in order to call yourself "Unix", rather than just being Unix-like. Technically, Unix certification and POSIX certification are separate, you can certify as either. Unix certification: https://www.opengroup.org/openbrand/register/ https://www.opengroup.org/openbrand/register/ POSIX certification: https://posix.opengroup.org/register.html https://posix.opengroup.org/register.html
- BoingBoomTschak 2y ago>such as MacOS, that are fully compliant with the POSIX standard Until you have to gets your hands dirty and find small and bigger faults everywhere. For example, /bin/sh defaults to their ancient (last GPL2 release) bash that doesn't work properly in these two parameter expansion cases: $ cat test.sh var= echo "${var+{\}}" cat <<EOF ${var+\"z\"} EOF $ /bin/sh test.sh {\} \"z\" $ /bin/dash test.sh {} "z" Second one bit me quite badly when doing heredocs to generate JSON.
- Karellen 2y agoProgram^WCompliance testing can be a very effective way to show the presence of bugs, but it is hopelessly inadequate for showing their absence. -- Edsger Dijkstra (ish)
- eadmund 2y agoIt really says something about how much Apple cares about restricting its users’ freedom versus implementing functionality for those users that in 17 years they haven’t been bothered to either write their own /bin/sh, fix the ca. 2007 bash they do ship or just ship a newer, GPLv3 bash. And it really says something about how important it is to license one’s software under GPLv3 or similar!
- icedchai 2y agoThey basically want you to use zsh... It's been the default shell for a while. If you want a newer version of bash, install it yourself with brew or macports.
- BoingBoomTschak 2y agoWhat's even more comical is that they also ship dash, as shown in my example! But the reason why is obvious: people using a /bin/sh shebang with bash features. So I understand, but patching bash to fix the --posix mode should still be done.
- deleted 2y ago[deleted]
- paulddraper 2y agoI think it's best to consider MacOS not having bash by default. (The OS shell of choice being zsh.)
- glhaynes 2y agoThat might hold more weight for me if it weren't the easiest thing in the world to install bash! Like literally `brew install bash` will do it, right? That way I'm not reliant on Apple at all, which seems optimal when we're talking about features they don't build and that aren't their focus. I'm very happy to let Apple do the things they're good at and the community do the things they're good at.
- BoingBoomTschak 2y ago
- foldr 2y agoApple added /bin/dash in Catalina, and the intention is probably to eventually to use dash as the implementation of sh: https://scriptingosx.com/2020/06/about-bash-zsh-sh-and-dash-in-macos-catalina-and-beyond/#:~:text=Apple%20also%20added%20dash%20(but,the%20interpreter%20for%20sh%20scripts https://scriptingosx.com/2020/06/about-bash-zsh-sh-and-dash-.... As for why they haven't done it yet, I'd guess it's just to preserve backward compatibility with old scripts that rely on quirks of bash's sh compatibility mode.
- lelandfe 2y agoOh they added it to recovery too. Interesting.
- kergonath 2y ago> Until you have to gets your hands dirty and find small and bigger faults everywhere. For example, /bin/sh defaults to their ancient It’s irrelevant. Neither POSIX nor the UNIX certification (or being a descendant of the UNIXes of old like the BSDs) requires a recent GNU userland (which is, as the name implies, not UNIX).
- Karellen 2y ago> > > such as MacOS, that are fully compliant with the POSIX standard > > Until you have to gets your hands dirty and find small and bigger faults everywhere. For example, /bin/sh [...] doesn't work properly in these two parameter expansion cases: > It’s irrelevant. Neither POSIX nor the UNIX certification [...] requires a recent GNU userland Is it irrelevant? If an implementation passes the conformance test suite, but is buggy according to the text of the spec in a way that is not caught by the test suite, can one really say it's "fully compliant with the POSIX standard"? Is it the test suite that's the final arbiter of the POSIX standard, or is the text of the spec? Because I thought that the point of having a written spec, ratified by a standards body, is that the text of the spec defines what the spec is. It is the text of the spec that is submitted to the standards body, after all, not the test suite.
- BoingBoomTschak 2y agoI said /bin/sh, not /bin/bash.
- postmodest 2y agoThey dropped any utility that switched to GPLv3 because of v3's infectious patent clause that would've put their patent portfolio in danger.
- TheFuzzball 2y agoThe default shell on macOS has been zsh for over 4 years now, and they keep it up-to-date.
- tialaramex 2y agoWe typically distinguish UNIX® which is everybody who has money and wanted to say they're Unix, from just Unix, meaning the things that in practice behave like Unix. Money talks, so I'm confident that Apple will get to call their mac OS UNIX® until they don't care regardless of whether in any useful sense it's still Unix. On the other hand, regardless of whether some organisation pays money to effect this, Linux is still Unix and so is FreeBSD. You've probably seen other situations in the real world where the thing you actually care about is distinct from legal status - because our social cues aren't tied to legal status. That doesn't make the legal status worthless, but it is distinct - Obergefell for example is a case where doubtless normal people just accepted that these guys are married - there was a ceremony and everything, but in Ohio at the time the asserted legal status was that they aren't married, therefore the death certificate claims otherwise and hence the case in front of the Supreme Court.
- iforgotmysocks 2y agoIronically the macOS kernel is named XNU - X is Not Unix
- krylon 2y agoApparently Oracle has stopped caring, new Solaris releases haven't been certified in a few years, says Wikipedia. I don't really know what the certification gets you these days other than bragging rights. I imagine in the past, government and corporate customers had check lists that included a box for "certified Posix", but I'm not sure if that is still the case.
- mtillman 2y agoIt is/was a useful credential to have when responding to government RFPs as governments had purchased UNIX systems and wanted new systems to be interoperable. This might no longer be an advantage in most requests but my guess is there are still some that require it.
- graemep 2y agoThere is another meaning. Derived from originally Unix code: so MacOS and FreeBSD are Unix, while Linux is not.
- chasil 2y ago> The current POSIX standard defines source code-level compatibility for only two programming languages: The C language (C99) and the command language (shell). AWK is also defined in the standard. Yes, subtleties are lost here.
- chasil 2y agosed is also a Turing-complete language.
- vorakl 2y agoInteresting! I just wonder... How would you do a conditional branching in sed?
- chasil 2y agoThere is a conditional branch instruction in sed that is taken if the last substitute command was successful. The O'Reilly book on sed & awk is available online for free from various sources (I grabbed a rar archive of it from somewhere). https://freecomputerbooks.com/The-Unix-CD-Bookshelf-Version-2-1.html https://freecomputerbooks.com/The-Unix-CD-Bookshelf-Version-...
- vorakl 2y agoIt's a good point! I've addressed it. I referred here to the following definition: "2.4 Other Language-Related Specifications POSIX.1-2017 is currently specified in terms of the shell command language and ISO C. Bindings to other programming languages are being developed." But, you are definitely right that some of the tools, defined as standard "utilities", such as AWK, also have their own language. Although, it is only defined in the "utilities" section, https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/a... However, "sh" is also defined under "utilities", although it has an extensive language specification that is provided as a separate document.
- chasil 2y ago
- frizlab 2y agomacOS is UNIX certified AFAICT though https://www.opengroup.org/openbrand/register/ https://www.opengroup.org/openbrand/register/
- RobotToaster 2y agoIt's funny that EulerOS is a GNU/Linux distro that is unix certified, despite GNU standing for "Gnu's not UNIX".
- squarefoot 2y ago> So there could be (and likely are) implementations out there which are fully compliant with the standard, but have not chosen to get certified, and are therefore technically still "not Unix". I'm not sure about certification, as compliance was mandated by the US Govt so there may have been one, but Windows NT had its POSIX API layer which I used ages ago to port some Unix network code to it just by changing a couple lines. No tools or anything else, that is, one didn't have a POSIX shell or any usual Unix tool, but the way to say open a socket and initiate network traffic was pretty much the same.
- vorakl 2y agoThanks for pointing this out! I have addressed this important detail.