title: Kill pid by found name in adb shell
body: <p>I am trying kill the process by pid but without success yet.
  To get pid I use command in adb shell:</p>
  
  <pre><code>echo $(ps |grep myword) | cut -d' ' -f2
  </code></pre>
  
  <p>To kill pid I use command:</p>
  
  <pre><code>kill &lt;PID&gt;
  </code></pre>
  
  <p>But I cannot join that two commands.. What I've tried was:</p>
  
  <pre><code>kill $($(ps |grep debug) | cut -d' ' -f2)
  </code></pre>
  
  <p>but it is somehow wrong. Could I ask you for a help?</p>
  
  <p><strong>tl;dr</strong></p>
  
  <p>The problem is about joining two commands in adb shell, android console -to kill process found by name.</p>
  
  <pre><code>echo $(ps |grep myword) | cut -d' ' -f2
  kill &lt;PID&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>I forgot to say</strong>: I am working on Windows7, so grep might not working in console. <strong>Really sorry for this.</strong></p>
  
  <p>I also tried this command:</p>
  
  <pre><code>adb shell "su -c 'echo $(ps | grep process_name) | cut -d' ' -f2 | xargs kill'"
  </code></pre>
  
  <p>This example is working well, however last part <code>xargs</code> fails:</p>
  
  <pre><code>adb shell ^" "su -c 'echo $(ps | grep ror)'|cut -d' ' -f2"
  </code></pre>