lzbench icon indicating copy to clipboard operation
lzbench copied to clipboard

Piping through tee doesn't work

Open tansy opened this issue 1 year ago • 2 comments

Whenever I want to write result from the screen to file I redirect or pipe through tee (1) but here it doesn't work. Nothing gets onto the screen, only at the end of the program it is written to the file, along with Bunch of other logging stuff.

I don't know where it come from as program uses printf() to write on the screen/stdout.

$ lzbench -ezlib,1 lzbench > log
$ lzbench -ezlib,1 lzbench | tee log

tansy avatar Mar 25 '24 00:03 tansy

I used ./lzbench -r -v -elz4/zstd/snappy silesia > result.txt and it did work for me

ChristianSchindler avatar Apr 04 '24 16:04 ChristianSchindler

And what did you see on the screen?

Same with tee, but one would expect to see something on the screen.

Try this (below) and check the difference between lzbench file | tee log.

$ while [ true ]; do echo $i; i=$((i+1)); sleep 1; done | tee log

And compare it to this (which is what you propose):

$ while [ true ]; do echo $i; i=$((i+1)); sleep 1; done > log

Do you see a difference?

tansy avatar Apr 04 '24 22:04 tansy