title: How to get script file path inside script itself when called through sym link
body: <p>When I need to get path to the script file inside script itself I use something like this:</p>
  
  <pre><code>`dirname $0`
  </code></pre>
  
  <p>that works file until I call the script through sym link to it. In that case above code prints the location of the link instead the original file.</p>
  
  <p>Is there a way to get the path of the original script file, not the link?</p>
  
  <p>Thanks,
  Mike</p>