linux - Continuously print stdout and write to file -


i have program intermittently print stdout. want see output on screen , redirect file.

i can use tee follows:

foo | tee ./log.txt 

however, print output screen when foo has terminated not allowing me observe progress of program.

is there way continuously show output of program , redirect log file?

is acceptable write output file , display live ?

$> foo > ./log.txt & tail -f ./log.txt 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -