views:

788

answers:

3

direct console to ok.log, and errors to error.log for example

+2  A: 
[your command] > ok.log 2> error.log
Jacob
I tried that, it just writes to file and doesnt show any output
codeninja
amvx - are you sure you are writing to stdout and stderr, and are you sure that your %CTODAY% is valid? 'cause if I do it with Python, everything works as expected.
dash-tom-bang
Ah, so you mean show output on "the screen."
Jacob
+1  A: 

The only way that I have found to do this is by using some variant of the UNIX tee command. You would use it like:

[your command] 2> error.log | tee ok.log
D.Shawley
+1  A: 

OK, if your goal is to split output into both stdout and a file, take a look at this SO question.

Jacob