From: Maxim Mamontov Date: Fri, 10 Oct 2014 19:15:22 +0000 (+0300) Subject: Parse admins list. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/c0e423f3a00da01cdcc994e973d0f04c7c956bae Parse admins list. --- 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