title: Is there a minimally POSIX.2 compliant shell?
body: <p>Is there a minimally <a href="http://en.wikipedia.org/wiki/POSIX" rel="nofollow noreferrer">POSIX</a>.2 compliant shell (let's call it <code>mpcsh</code>) in the following sense:</p>
  <p>if <code>mpcsh myscript.sh</code> behaves correctly on my (compliant) system then <code>xsh myscript.sh</code>  will behave identically for any POSIX.2 compliant shell <code>xsh</code> on any compliant system.  (&quot;Identically&quot; up to less relevant things like the wording of error messages etc.)</p>
  <p>Does <a href="http://en.wikipedia.org/wiki/Debian_Almquist_shell" rel="nofollow noreferrer">dash</a> qualify?</p>
  <p>If not, is there any way to verify compliance of <code>myscript.sh</code>?</p>
  <hr />
  <p>Edit (9 years later):</p>
  <p>The accepted answer still stands, but have a look at <a href="https://dev.to/bowmanjd/writing-bash-scripts-that-are-not-only-bash-checking-for-bashisms-and-testing-with-dash-1bli" rel="nofollow noreferrer">this blog post</a> and the <code>chackbashisms</code> command (<a href="https://sourceforge.net/projects/checkbaskisms/" rel="nofollow noreferrer">source</a>). Avoiding bashisms is not the same as writing a POSIX.2 compliant shell script, but it comes close.</p>