title: bash script - kill all same processes instead of this one
body: <p>I have a (bash or csh) script run by the user manually... called myScript.sh</p>
  
  <p>I want to check if there are other instances of this script running and kill them, then start doing its work.</p>
  
  <p>I tried:</p>
  
  <pre><code>ps -ef | grep "myScript.sh" | grep -v grep | awk '{print $2}' | xargs kill -9
  </code></pre>
  
  <p>But it also finds itself and kills everything else and then commits suicide!!!</p>
  
  <p>Any smart quick way to just kill the rest? (without having to do it on another wrapper script) ??</p>