function kill_process
{
for pid in `cat $1`
do
{
echo "$pid"
kill -9 $pid
}
done
rm -f $1
}
ps aux | grep "cef" | grep -v "grep" | awk '{print $2}' > /tmp/cef.pid
kill_process "/tmp/cef.pid"
ps aux | grep "mas" | grep -v "grep" | awk '{print $2}' > /tmp/mas.pid
kill_process "/tmp/mas.pid"
ps aux | grep "jboss" | grep -v "grep" | awk '{print $2}' > /tmp/jboss.pid
kill_process "/tmp/jboss.pid"
ps aux | grep "snmp" | grep -v "grep" | awk '{print $2}' > /tmp/snmp.pid
kill_process "/tmp/snmp.pid"
ps -a | grep cef | grep -v cef_monitor | grep -v grep | awk '{printf("kill -9 %s\n",$1)}' | sh
ps -a | grep mas | grep -v grep | awk '{printf("kill -9 %s\n",$1)}' | sh
ps -a | grep jboss | grep -v grep | awk '{printf("kill -9 %s\n",$1)}' | sh
ps -a | grep snmp | grep -v grep | awk '{printf("kill -9 %s\n",$1)}' | sh
yezhulin1982 于 2007-11-12 10:50:16发表:
不错,学习了。