<story><title>A few facts about POSIX</title><url>https://vorakl.com/articles/posix/</url></story><parent_chain><item><author>BoingBoomTschak</author><text>&amp;gt;such as MacOS, that are fully compliant with the POSIX standard&lt;p&gt;Until you have to gets your hands dirty and find small and bigger faults everywhere. For example, &amp;#x2F;bin&amp;#x2F;sh defaults to their ancient (last GPL2 release) bash that doesn&amp;#x27;t work properly in these two parameter expansion cases:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  $ cat test.sh
  var=
  echo &amp;quot;${var+{\}}&amp;quot;
  cat &amp;lt;&amp;lt;EOF
  ${var+\&amp;quot;z\&amp;quot;}
  EOF
  $ &amp;#x2F;bin&amp;#x2F;sh test.sh
  {\}
  \&amp;quot;z\&amp;quot;
  $ &amp;#x2F;bin&amp;#x2F;dash test.sh
  {}
  &amp;quot;z&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
Second one bit me quite badly when doing heredocs to generate JSON.</text></item><item><author>Karellen</author><text>&amp;gt; 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.&lt;p&gt;It&amp;#x27;s a bit more nuanced than this. Being fully compliant with the POSIX standard isn&amp;#x27;t quite enough; you have to pass an official conformance test suite &lt;i&gt;and be certified by the Open Group&lt;/i&gt; to have passed it, in order to call yourself &amp;quot;Unix&amp;quot;, rather than just being Unix-like.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Single_UNIX_Specification&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Single_UNIX_Specification&lt;/a&gt;&lt;p&gt;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 &amp;quot;not Unix&amp;quot;.</text></item></parent_chain><comment><author>eadmund</author><text>It 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 &amp;#x2F;bin&amp;#x2F;sh, fix the ca. 2007 bash they do ship or just ship a newer, GPLv3 bash.&lt;p&gt;And it really says something about how important it is to license one’s software under GPLv3 or similar!</text></comment>
<story><title>A few facts about POSIX</title><url>https://vorakl.com/articles/posix/</url></story><parent_chain><item><author>BoingBoomTschak</author><text>&amp;gt;such as MacOS, that are fully compliant with the POSIX standard&lt;p&gt;Until you have to gets your hands dirty and find small and bigger faults everywhere. For example, &amp;#x2F;bin&amp;#x2F;sh defaults to their ancient (last GPL2 release) bash that doesn&amp;#x27;t work properly in these two parameter expansion cases:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  $ cat test.sh
  var=
  echo &amp;quot;${var+{\}}&amp;quot;
  cat &amp;lt;&amp;lt;EOF
  ${var+\&amp;quot;z\&amp;quot;}
  EOF
  $ &amp;#x2F;bin&amp;#x2F;sh test.sh
  {\}
  \&amp;quot;z\&amp;quot;
  $ &amp;#x2F;bin&amp;#x2F;dash test.sh
  {}
  &amp;quot;z&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
Second one bit me quite badly when doing heredocs to generate JSON.</text></item><item><author>Karellen</author><text>&amp;gt; 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.&lt;p&gt;It&amp;#x27;s a bit more nuanced than this. Being fully compliant with the POSIX standard isn&amp;#x27;t quite enough; you have to pass an official conformance test suite &lt;i&gt;and be certified by the Open Group&lt;/i&gt; to have passed it, in order to call yourself &amp;quot;Unix&amp;quot;, rather than just being Unix-like.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Single_UNIX_Specification&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Single_UNIX_Specification&lt;/a&gt;&lt;p&gt;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 &amp;quot;not Unix&amp;quot;.</text></item></parent_chain><comment><author>foldr</author><text>Apple added &amp;#x2F;bin&amp;#x2F;dash in Catalina, and the intention is probably to eventually to use dash as the implementation of sh: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;scriptingosx.com&amp;#x2F;2020&amp;#x2F;06&amp;#x2F;about-bash-zsh-sh-and-dash-in-macos-catalina-and-beyond&amp;#x2F;#:~:text=Apple%20also%20added%20dash%20(but,the%20interpreter%20for%20sh%20scripts&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;scriptingosx.com&amp;#x2F;2020&amp;#x2F;06&amp;#x2F;about-bash-zsh-sh-and-dash-...&lt;/a&gt;.&lt;p&gt;As for why they haven&amp;#x27;t done it yet, I&amp;#x27;d guess it&amp;#x27;s just to preserve backward compatibility with old scripts that rely on quirks of bash&amp;#x27;s sh compatibility mode.</text></comment>