From: Joseph McDonald Date: 2001-09-21T04:39:33+09:00 Subject: [ruby-talk:21456] Re: Interaction system() / $stdout ? JH> I've been trying to redirect the output of commands invoked by JH> "system", by changing the $stdout variable in Ruby. This appears to work: $saved_stdout = $stdout.dup $stdout = File.open("log-file", "w") system "echo After redirect, to log-file I hope." $stdout = $saved_stdout.dup system "echo Original restored, to STDOUT I hope." I'm not sure why that second "dup" is necessary, perhaps a guru can elaborate or give a better solution. regards, -joe