title: Shell script to capture Process ID and kill it if exist
body: <p>I tried this code and it is not working</p>
  
  <pre><code>#!/bin/sh
  
  #Find the Process ID for syncapp running instance
  
  PID=`ps -ef | grep syncapp 'awk {print $2}'`
  
  if [[ -z "$PID" ]] then
  Kill -9 PID
  fi
  </code></pre>
  
  <p>It is showing a error near awk.</p>
  
  <p>Any suggestions please.</p>