title: How to get script directory in POSIX sh?
body: <p>I have the following code in my bash script. Now I wanna use it in POSIX sh. How can I convert it?</p>
  
  <pre><code>DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &gt; /dev/null &amp;&amp; pwd )"
  </code></pre>