Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a batch file written that runs a program we've developped, passing in a number of parameters. Whilst running the program in debug mode, a large number of debug messages are output, which it would be handy to review later, although I still want to be able to see the program running "live" as it were, within the cmd.exe window.

In a *nix environment I could use Tee to output to both the text file and stdout. Any suggestions?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

TEE for Windows
TEE enables you to redirect standard output to a file and display it on screen simultaneously.

some_program | TEE [ /D:nn ] file_name

Available as BAT, Perl and Regina scripts.

Author's note.

The Rexx and Perl scripts will start displaying the result immediately. For the batch file, what it boils down to is, you may just as well redirect the command's output to a file and then display that file afterwards. As a bonus, that way you won't skip empty lines.

Note: These scripts were written just for fun. Even though the do work, they cannot compete with the "real" stuff -- compiled executables, written in "true" programming languages by true programmers.


I use Cygwin.
There is also Tee utility for Windows updated

share|improve this answer
    
Unfortunately Cygwin's not an option here. Works a treat though, and the zip includes a compiled executable as well. Perfect! –  Edd Aug 25 '09 at 10:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.