title: Using a shell script to automatically kill processes
body: <p>I am looking for a command that will find PIDs such as:</p>
  
  <pre><code>ps -ef | grep com.sds.afi.rte.cosmos-1.0.0.jar
  cosmos    4690  4689  3 14:27 pts/8    00:00:06 java -Dlog4j.debug -Dlog4j.configuration=file:/data/cosmos/sim/bin/log4j.xml -jar com.sds.afi.rte.cosmos-1.0.0.jar
  cosmos    5484  5482  0 14:30 pts/11   00:00:00 grep com.sds.afi.rte.cosmos-1.0.0.jar
  </code></pre>
  
  <p>and then kill these processes using:</p>
  
  <pre><code>kill -9 pid
  </code></pre>
  
  <p>How can I make a shell script that will do all the above automatically ?</p>