From c0e423f3a00da01cdcc994e973d0f04c7c956bae Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Fri, 10 Oct 2014 22:15:22 +0300 Subject: [PATCH] Parse admins list. --- functest/test.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/functest/test.sh b/functest/test.sh index 62a8a581..de55a588 100755 --- a/functest/test.sh +++ b/functest/test.sh @@ -61,7 +61,27 @@ then exit 0 fi -printf "Got admins list:\n$RES\n" +printf "Got admins list:\n" + +LOGINS="" +OLDIFS=$IFS +IFS=$(printf "\n") +for LINE in $RES +do + printf -- "$LINE\n" + LOGIN=`echo $LINE | grep login` + if [ "$?" == "0" ] + then + LOGINS="$LOGINS\n"`echo $LOGIN | cut -d: -f2 | sed -e 's/^ *//' -e 's/ *$//'` + fi +done +IFS=$OLDIFS + +printf "Logins:\n$LOGINS\n" + +NUM=`echo $LOGINS | wc -l` + +printf -- "--------\n$NUM\n\n" printf "Stopping...\n" kill $PID -- 2.44.2