From: Paul Brannan Date: 2002-04-12T08:01:28+09:00 Subject: Re: Process controlls On Fri, Apr 12, 2002 at 06:16:42AM +0900, JohnW wrote: > I'm a QA guy that wants to automate testing. The test involves > launching an executable...which, in turn, launches other executables. > I want to be able to have the script maintain focus and wait for the > test to finish (I drop a done file) then send like a ^C to the process > it started. I am a fellow test writer. I've needed to do something similar in my tests. I use CORBA to communicate between the processes (I get Ruby to talk CORBA via a C++ extension). My code looks something like: pid = fork do exec "/bin/foo" end begin sleep(5) # wait for the child to start $obj->foo() # make a CORBA call and wait for it to return ensure Process.kill("SIGTERM", pid) end If you want to simulate a Ctrl-C, then you might try using SIGINT instead of SIGTERM. In your case, instead of waiting for a CORBA call to return, you want to wait for a file to appear: catch :done do loop do begin File.open("filename") { throw :done } rescue Exception end sleep 1 end end (maybe not the simplest way to do this, but I think it will work). Hope this helps, Paul