in reply to How to tee STDERR on Windows
This is one heck of an ugly Win10 command line solution. But I tested this on my machine and it does work. I admit that I am still struggling to understand exactly why it works. I make no claims other than I did test this on Win10 home edition with an actual Perl program.
Win10prompt>for /f "delims=" %L in ('perl testchompwhile.pl 2^>^&1') do @echo %L & echo %L >> log
I happened to have a short Perl program that I wrote for another post for testing. This appends both STDERR and STDOUT to log and of course the also both go to screen as requested.
update: The only other info I have about this is: "The for command iterates over the output lines of the script. The carets escape the characters that follow them. The first echo goes to the screen and the second is appended to the file named "log"."
|
|---|