From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-05-07T08:53:33+09:00 Subject: Re: capture output On Wed, 07 May 2003 00:02:09 +0000, ahoward wrote: > res = capture { > puts "1" > #system("ruby output.rb") # BOOM - Output is not being captured? > load 'output.rb' ^^^^ ^^^^ Sorry. Load does not solve it. I want to execute arbitrary unix-programs and capture all their output. This was just the simples way I could get different kinds of output. > puts "2" > } > puts res.collect{|s| "OK "+s }.join("\n") I am embedding ruby into another application and therefore I want to redirect all rubys output elsewhere.. so that ruby is 100% silent. Things I know of which can generate output: system("echo hello") `echo hello` puts print printf How do I overload "system" and "backquote" ? How do I ensure ruby stays 100% silent ??? -- Simon Strandgaard