|
发表于 2008-12-29 13:43:35
|
显示全部楼层
你的脚本不对。好好学习一下Shell吧
Post by think365;1931206
已经写了一个脚本,可以读出进程号,但是不能杀死进程?
脚本为:
PIDNUM= cat pid
echo ${PIDNUM}
kill -9 ${PIDNUM} (这样写没错吧?)
运行输出如下:
[root@/etc/opt/ss5]#./stop
9595
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] (怎么出错了呢?) - PIDNUM="$(cat pid)"
- echo ${PIDNUM}
- kill -9 ${PIDNUM}
复制代码 |
|