From: Takaaki Tateishi Date: 2001-09-28T00:29:59+09:00 Subject: [ruby-list:31621] Re: interrupt by Ctrl-C, and continue? 立石です. At Thu, 27 Sep 2001 23:52:39 +0900, Kotaro Taki wrote: > 質問なのですが、UNIX 上で、以下の条件で動かしたいのです。 > - 子プロセスとしてシステムコマンドを実行する > - script の実行中に Ctrl-C で止めた場合、以後の実行を行わない > - エラーで終了した場合は実行を続行する 簡単に書くと,このような感じでしょうか? trap("SIGINT"){ print("\nterminated\n") exit(0) } def execute(cmd) fork{ exec(cmd) } Process.wait # pid,status = Process.wait2 end execute("...") execute("...") execute("...") -- Takaaki Tateishi