Merge "pid: switch to pgrep."

am: 3aa9457410

Change-Id: Ie2cbb889773651c922095a7fa7ae983c8431b1d8
This commit is contained in:
Josh Gao
2018-07-23 19:00:14 -07:00
committed by android-build-merger

View File

@@ -28,12 +28,10 @@ fi
if [ $EXACT == 1 ]; then if [ $EXACT == 1 ]; then
PIDS="$(adb shell pidof $EXE)" PIDS="$(adb shell pidof $EXE)"
RC=$?
else else
PIDS=$(adb shell "ps -o PID,NAME | tail -n +1 | grep $EXE | tr -s ' ' | cut -f2 -d' '") PIDS="$(adb shell pgrep -f $EXE)"
[ -n "$PIDS" ]
RC=$?
fi fi
RC=$?
for PID in $PIDS; do for PID in $PIDS; do
echo $PID echo $PID