Force line-buffering of stdout in a pipeline
you can try stdbuf $ stdbuf –output=L ./a | tee output.txt (big) part of the man page: -i, –input=MODE adjust standard input stream buffering -o, –output=MODE adjust standard output stream buffering -e, –error=MODE adjust standard error stream buffering If MODE is ‘L’ the corresponding stream will be line buffered. This option is invalid with standard … Read more