|

楼主 |
发表于 2006-9-30 20:49:43
|
显示全部楼层
太谢谢各位啦,要好好向各位学习:)
我想知道的是如何获得要查找的进程的PID呢?:(
Post by shizi4838
1 设置PS1
2
-
- if (ps -ef |grep "进程名" >/dev/null 2>&1)
- then
- echo "press K to kill the process or R to restart the process"
- read RES
- case $RES in
- k) 杀进程
- ;;
- R) 重启进程
- ;;
- *) echo "press K to kill the process or R to restart the process"
- ;;
- esac
- else
- echo "没有该进程"
- fi
复制代码 |
|