I wrote a program capture which output stdout message as well as stderr message (i.e, printf(), fprintf(stderr,..))
and I want the print information to be displayed on terminal as well as saved into log file.
./capture 2>&1|tee log
but I see that the stdout and stderr messages seem not to be in order in the log file.
does output redirection write stdout and stderr info in order? if not, what can I do to make them in order?