How to search a digit i.e process id in tcl and kill the process id

前端 未结 4 818
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 09:48

I have tried to search process id i-e 6762 stored in a variable say buffer

nohup tcpdump -ni  eth0 -s0  2>&1          


        
4条回答
  •  生来不讨喜
    2021-01-27 10:37

    If you want to try to kill it,

    try {
        exec sh -c "kill -0 $pid && kill $pid"
    } on error e {
        puts "could not kill $pid: $e"
    }
    

    The kill -0 $pid is just a test to see if such a pid is running.

提交回复
热议问题