Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Use of tee command promptly even for one command




I am new to using tee command.

I am trying to run one of my program which takes long time to finish but it prints out information as it progresses. I am using 'tee' to save the output to a file as well as to see the output in the shell (bash).

But the problem is tee doesn't forward the output to shell until the end of my command. Is there any way to do that ?

I am using Debian and bash.

like image 817
Rakib Avatar asked Oct 07 '22 18:10


1 Answers

This actually depends on the amount of output and the implementation of whatever command you are running. No program is obliged to print stuff straight to stdout or stderr and flush it all the time. So even though most C runtime implementation flush after a certain amount of data was written using one of the runtime routines, such as printf, this may not be true depending on the implementation.

It tee doesn't output it right away, it is likely only receiving the input at the very end of the run of your command. It might be helpful to mention which exact command it is.

like image 197
0xC0000022L Avatar answered Oct 10 '22 23:10