title: Why does this sh shebang not work?
body: <p>In the following script (saved as <code>script.sh</code>):</p>
  
  <pre><code>#!/bin/sh
  cd $MY_PYTHON_WORKING_DIRECTORY
  python script1.py
  python script2.py
  </code></pre>
  
  <p>Then, when I try to run the command <code>script.sh</code> in my bash shell, I got the error <code>bash: script.sh: command not found</code>. Why does this not work as expected? If the first line of any scripts start by <code>#!</code> prefix, then the following path on the line is interpreted as a command, right? For your information, even if I changed my first line to <code>#!/bin/bash</code>, the same error still occurred. If I run the script as either <code>sh script.sh</code> or <code>bash script.sh</code>, then the script ran as expected.</p>
  
  <p>Is there any way to run the script by just hitting <code>script.sh</code>?</p>
  
  <p>One more question, between <code>sh</code> and <code>bash</code>, which should I use? I'm on OS X 10.8 and my default shell is currently set <code>bash</code>, but I wonder which one to use going forward.</p>
  
  <p>Thanks.</p>