Merge "fix uses of grep in envsetup.h" into klp-dev

This commit is contained in:
Mathias Agopian 2013-08-27 22:09:01 +00:00 committed by Android (Google) Code Review
commit 5a4cc0da02
1 changed files with 3 additions and 3 deletions

View File

@ -803,7 +803,7 @@ function qpid() {
local EXE="$1" local EXE="$1"
if [ "$EXE" ] ; then if [ "$EXE" ] ; then
qpid | grep "$prepend$EXE$append" qpid | \grep "$prepend$EXE$append"
else else
adb shell ps \ adb shell ps \
| tr -d '\r' \ | tr -d '\r' \
@ -824,7 +824,7 @@ function pid()
if [ "$EXE" ] ; then if [ "$EXE" ] ; then
local PID=`adb shell ps \ local PID=`adb shell ps \
| tr -d '\r' \ | tr -d '\r' \
| grep "$prepend$EXE$append" \ | \grep "$prepend$EXE$append" \
| sed -e 's/^[^ ]* *\([0-9]*\).*$/\1/'` | sed -e 's/^[^ ]* *\([0-9]*\).*$/\1/'`
echo "$PID" echo "$PID"
else else
@ -930,7 +930,7 @@ function gdbclient()
if [[ ! "$PID" =~ ^[0-9]+$ ]] ; then if [[ ! "$PID" =~ ^[0-9]+$ ]] ; then
# that likely didn't work because of returning multiple processes # that likely didn't work because of returning multiple processes
# try again, filtering by root processes (don't contain colon) # try again, filtering by root processes (don't contain colon)
PID=`adb shell ps | grep $3 | grep -v ":" | awk '{print $2}'` PID=`adb shell ps | \grep $3 | \grep -v ":" | awk '{print $2}'`
if [[ ! "$PID" =~ ^[0-9]+$ ]] if [[ ! "$PID" =~ ^[0-9]+$ ]]
then then
echo "Couldn't resolve '$3' to single PID" echo "Couldn't resolve '$3' to single PID"