Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
kill -9 @pidこんにちは、system( )を使用して pid でプロセスを強制終了しようとしていますが、Ruby でそれを行う方法はどこにありますか@pid?@pid = %x[pidof program firefox]
kill -9 @pid
@pid
@pid = %x[pidof program firefox]
それはうまくいくはずです。試す
command = "kill -9 #{@pid}" system(command)
バックティック:
`kill -9 #{@pid}`
ピュア ルビー:
http://www.ruby-doc.org/core-1.9.3/Process.html#method-c-kill
実際に試したことはありませんが、役に立ったら見てみてください。
RAA - sys-proctable