#!/usr/bin/sh
while [ 1 ]
do
ps_types="`who -R|grep -v '10.71.175.39'|grep -v grep|awk '{print $2}'`"
#echo ${ps_types}
for ps_t in "${ps_types}"
do
ps -u $LOGNAME|grep csh|grep -v grep|awk -v ps_t="${ps_t}" 'BEGIN{split(ps_t,psarray," ")}{ for (i in psarray) {if ($2==psarray[i]) printf "kill_pid.sh %s
\n",$1}}'|sh
done
who -R|grep $LOGNAME|grep -v grep
sleep 10
done
while [ 1 ]
do
ps_types="`who -R|grep -v '10.71.175.39'|grep -v grep|awk '{print $2}'`"
#echo ${ps_types}
for ps_t in "${ps_types}"
do
ps -u $LOGNAME|grep csh|grep -v grep|awk -v ps_t="${ps_t}" 'BEGIN{split(ps_t,psarray," ")}{ for (i in psarray) {if ($2==psarray[i]) printf "kill_pid.sh %s
\n",$1}}'|sh
done
who -R|grep $LOGNAME|grep -v grep
sleep 10
done