7 ms·
A few facts about POSIX
- deleted 2y ago[deleted]
- augustk 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)." There is also a definition of AWK: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/a...
- dspillett 2y agoThere is an argument that Awk's language isn't the same category as it is a DSL not intended to be a general purpose language (it is turning-complete, but was not specifically designed as such), and awk itself is considered a complex tool not a language interpreter. Though having said that, any definition that separates awk from general programming languages like that could probably apply to shell syntax too.
- anthk 2y agoAwk can do more than you think. Read The AWK Progamming Language. Also: gopher://hoi.st/1/dl and gopher://hoi.st/0/files/tgl.awk make up a pretty complete language. Don't think on AWK as a more powerful grep, you are missing a great mini-language.
- skissane 2y agoThere used to be POSIX.5 which standardised Ada bindings and POSIX.9 which standardised Fortran bindings, but both were abandoned (I assume due to lack of interest)
- fanf2 2y agoand sed https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/s... and m4 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/m4.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/m... and ex https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/e... and bc https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/b... unix isn’t short of programming languages!
- iaabtpbtpnn 2y agoJust short of good ones!
- vorakl 2y agoCertainly true. I just referred to this 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." I've added a few words and links to other "utilities".
- bigdub69 2y ago[dead]
- 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)
- CoastalCoder 2y agoI really appreciate that at the top of the article, the author has a link to a bulleted summary of the article. It's a classy move: it shows respect for the readers' time.
- rurban 2y agoIt's missing all the anti facts, why the Unix Haters handbook exists. https://archive.org/details/TheUnixHatersHandbook/ https://archive.org/details/TheUnixHatersHandbook/ Horrible libc (strings, blocking IO, threads, locale, ...), why all our systems are catastrophically bloated and insecure. Garbage in, garbage out, the tagline of modern unix.