> watir-check.rb 2>&1 | tee watir-check.tmp > > I am using Windows XP so this is run in cmd.exe, but it normally works > with this syntax. (tee.exe is from gnuwin32.) > > This did not work, the .tmp file is created but is empty and I see > nothing in the console window.
Does running the command like this work for you? watir-check.rb | tee console.log I'm using WinXP and Cygwin's tee.exe. If I run scripts in the above fashion, I get the desired behavior - the script output shows up in the cmd.exe window and console.log at the same time. > Still the same problem. I tried to simplify even more: > > ruby watir-check.rb > watir-check.tmp > > To my surprise not even this worked. Odd, this should work. Are you running the command manually in the console window, or is another script/program executing the command? If all else fails, another (more complicated) way to do this is to write a little Ruby script that runs your Watir script using IO.popen, and uses the resulting IO object to read the standard output of the Watir script. The parent script can then do anything it wants with the output; in my case I wrote it to a file. When I tried saving the output of Watir scripts this way, it worked fine (although I've seen complaints about the reliability of Ruby's popen method on win32). But resorting to that shouldn't be necessary; hopefully you can get the tee.exe technique working. _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
