I am on a Windows 7 host with cygwin 1.7.0 installed.
I want to see the output of myTest.exe on the console and in the meanwhile have it written to myTest.log, but all output is shown only when myTest.exe is concluded.
I tried the solution suggested here and this works good. Then I wrote the following myTest.c
:
#include <stdio.h>
#include <Windows.h>
int main() {
printf ("hello\n");
Sleep(5000);
printf("goodbye\n");
return 0;
}
and compile it with the command
gcc myTest.c -o myTest
Executing test.exe
without tee works as expected, but if I execute
./myTest.exe | tee myTest.log
I get all output on the console only after myTest.exe
is done.
Any suggestions how I can get the output to the console while myTest.exe is still running?