From: ientu Date: 2005-10-14T00:51:54+09:00 Subject: Re: exec and pipe By the way the same *?wrong?* code is in the CookBook at http://pleac.sourceforge.net/pleac_ruby/processmanagementetc.html ..... # so the "clean and secure" version readme, writeme = IO.pipe pid = fork { # child $stdout = writeme readme.close exec('find', '..') } # parent Process.waitpid(pid, 0) writeme.close while readme.gets do # do something with $_ end .....