#!/bin/bash
top -b -n 1 >topinfo.txt
prog="nc -l 9944"
count=1;
echo "beging"
while [ count>0 ]
do
pnum=`ps -wef|grep "${prog}" |grep -v grep |grep " 1 "|wc -l`
echo $pnum
if test $pnum -lt 1
then
top -b -n 1 >topinfo.txt
nc -l 9944 fi
done
你可以用firfox浏览器查看了.如http://218.206.84.146:9944/