Ubuntu 20
, Bash 5
.
There is probably something silly I am overlooking! There is this C++ binary foo
, which uses std::cout
, printf()
and puts()
to do its logging.
When I run it as ./foo
from the terminal, I get some output (and a segmentation fault).
When I redirect everything ./foo > log
, I get only a part of the output. When I spread that ./foo 1>one 2>two
then one
, as expected, contains the shortened output and two
contains nothing.
There is (obviously) no central logging facility, so I can't imagine how to force flushing.
What could be wrong?
$./foo
text1
text2
$./foo > log ; cat log
text1
grep
. – terdon Jun 01 '20 at 11:07