title: How to get rid of extra characters in linux process ID using shell script
body: <p>I m trying to kill a process by its pid, and this is the script that I found from web.  </p>
  
  <pre><code>PID=`ps -ef | grep myProcess | grep -v grep | awk '{print $2}'`  
  echo -e Killing myProcess with pid: $PID..  
  </code></pre>
  
  <p>Output: Killing myProcesswith pid: 13275^M..</p>
  
  <p>Does anyone know why is there a ^M , how do I get rid of that because the kill command failed to run :  </p>
  
  <pre><code>**arguments must be process or job IDs**
  </code></pre>
  
  <p>I searched online but still got no idea how to overcome this..
  Any help is appreciated!! Thanks!</p>