--- test.sh_orig	2024-06-24 04:03:29.400043789 -0500
+++ test.sh	2024-06-24 04:03:39.915236905 -0500
@@ -823,7 +823,7 @@
 # return a list of child process pids [killchild]
 childpids () {
     case "$UNAME" in
-    AIX)     l="$(ps -fade |grep "^........ ...... $(printf %6u $1)" |awk '{print($2);}')" ;;
+    AIX)     l="$(ps -fade | grep "$(printf %6u $1)" | awk '{print($2);}')" ;;
     FreeBSD) l="$(ps -fl   |grep "^[^ ][^ ]*[ ][ ]*[0-9][0-9]*[ ][ ]*$1[ ]" |awk '{print($2);}')" ;;
     HP-UX)   l="$(ps -fade |grep "^........ ..... $(printf %5u $1)" |awk '{print($2);}')" ;;
 #    Linux)   l="$(ps -fade |grep "^........ ..... $(printf %5u $1)" |awk '{print($2);}')" ;;
@@ -1256,7 +1256,7 @@
 		[1-5]*) l=$(netstat -an |grep '^tcp.* .*[0-9*]\.'$port' .* \*\.\* .* LISTEN') ;;
 		*) l=$(netstat -an |grep '^tcp4.* .*[0-9*]\.'$port' .* \*\.\* .* LISTEN') ;;
 		esac ;;
-	AIX)     l=$(netstat -an |grep '^tcp[^6]       0      0 .*[*0-9]\.'$port' .* LISTEN$') ;;
+        AIX)     l=$(netstat -an |grep '^tcp[4].*'$port'.*LISTEN$') ;;
 	SunOS)   l=$(netstat -an -f inet -P tcp |grep '.*[1-9*]\.'$port' .*\* .* 0 .* LISTEN') ;;
 	HP-UX)   l=$(netstat -an |grep '^tcp        0      0  .*[0-9*]\.'$port' .* LISTEN$') ;;
 	OSF1)    l=$(/usr/sbin/netstat -an |grep '^tcp        0      0  .*[0-9*]\.'$port' [ ]*\*\.\* [ ]*LISTEN') ;;
@@ -15338,11 +15338,11 @@
 eval "$CMD0" >/dev/null 2>"${te}0" &
 pid0=$!
 waittcp4port $PORT 1
-$CMD1 >"${tf}1" 2>"${te}1" </dev/null
+$CMD1 >"${tf}1" 2>"${te}1"
 rc1=$?
 kill $pid0 2>/dev/null; wait
 result="$(head -n 1 ${tf}1 |awk '{print($2);}')"
-if [ $rc1 -eq 0 -a "$result" = tcp ]; then
+if [ $rc1 -eq 0 -a "$result" = "(stream)" ]; then
     $PRINTF "$OK\n"
     if [ "$VERBOSE" ]; then echo "$CMD0 &"; fi
     if [ "$DEBUG" ];   then cat "${te}0" >&2; fi
