title: Get adb log and grep it to a string in IF statement
body: <p>I want to grep a string to adb logcat and if it matches it should go inside if statement else exit.THe following code doesnot work</p>
  
  <pre><code>if[ ./adb logcat | grep --line-buffered 'Monkey aborted due to error.' ]; then
  adb logcat -d &gt; MONKEY_WORKING_DIR/logcat_MonkeyWithoutPackageName.txt
  fi
  </code></pre>