title: How to continue executing the next other commands after using "kill" in shell?
body: <p>I want to merge two different script files into one script file which could do what the two different files do. And the script files is:</p>
  
  <p>script file A:</p>
  
  <pre><code>pid=`ps -ef | grep temp_tool | grep -v grep | awk '{print $2}'`
  kill -9 ${pid}
  </code></pre>
  
  <p>script file B:</p>
  
  <pre><code>nohup ./temp_tool &amp;
  </code></pre>
  
  <p>the merged script file:</p>
  
  <pre><code>pid=`ps -ef | grep temp_tool | grep -v grep | awk '{print $2}'`
  kill -9 ${pid}
  nohup ./temp_tool &amp;
  </code></pre>
  
  <p>The whole merged script file would stop after executing <code>kill</code> command, and I have to modify it to be:</p>
  
  <pre><code>pid=`ps -ef | grep temp_tool | grep -v grep | awk '{print $2}'`
  out=`kill -9 ${pid}`
  nohup ./temp_tool &amp;
  </code></pre>
  
  <p>and it works well now, but I don't know why? Is there any difference?</p>