4

Redirecting stdout continously to a file

view full story
linux-howto

http://www.unix.com – I have a C program that continously outputs info to stdout. The problem is that I am redirecting the stdout and stderr to a file and stdout is written at the end of the problem rather than continously to the file. This could be a problem if for example the program is killed and the stdout output is lost. On the other hand, stderr is written continuously to the file. Thats the way I am doing the redirection of the stdout and stderr. Code: c_program > file.log 2>&1 Any ideas how can I redirect the stdout to the file continuously rather than at the end of the program? (HowTos)