From d43adfd72909cbe59b0d9d7ecebccf9141c1fdf3 Mon Sep 17 00:00:00 2001 From: Michael Moon Date: Sun, 7 Nov 2010 16:46:56 +1100 Subject: [PATCH] new protocol support for host-side debugging functions --- func.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/func.sh b/func.sh index 92788f1..8fdb7da 100755 --- a/func.sh +++ b/func.sh @@ -108,14 +108,12 @@ mendel_cmd() { local RSC=0 local cmd="$*" echo "$cmd" >&3; - while [ "$REPLY" != "OK" ] && [ "$REPLY" != "ok" ] + local REPLY="" + while ! [[ "$REPLY" =~ ^OK ]] && ! [[ "$REPLY" =~ ^ok ]] do read -u 3 - if [ "$REPLY" != "OK" ] && [ "$REPLY" != "ok" ] - then - echo "$REPLY" - fi - if [[ "$REPLY" =~ ^RESEND ]] + echo "${REPLY##ok }" + if [[ "$REPLY" =~ ^RESEND ]] || [[ "$REPLY" =~ ^rs ]] then if [ "$RSC" -le 3 ] then @@ -137,11 +135,12 @@ mendel_cmd_hr() { local RSC=0 echo "$cmd" >&3 echo "S> $cmd" - while [ "$REPLY" != "OK" ] && [ "$REPLY" != "ok" ] + local REPLY="" + while ! [[ "$REPLY" =~ ^OK ]] && ! [[ "$REPLY" =~ ^ok ]] do read -u 3 echo "