title: Exiting adb shell logcat inside a bash script
body: <p>When I run the following script, it hangs after the break, thus never executing the "do something else". I suspect that it's because after the break, adb shell logcat is still being executed. Manually pressing ctrl-c terminates logcat and allows do somethign else to execute, but is there a way to do this automatically?</p>
  
  <pre><code>adb logcat -c
  adb shell logcat -s "test" | while IFS=" " read -a Array
  do
      echo "${Array[2]} ${Array[3]}" 
      if [ "${Array[2]}" == "${Array[3]}" ]
      then echo "Equals"
          break
      fi
  done
  #do something else
  </code></pre>
  
  <p>Thanks</p>