Q:

Bash: Redirect each line of a program output to a file in live

I did the usual myprogram >> file but it's not updating live using tail -f file, is there a way to do it ? 

A:

A program can be unbuffered, line buffered or block buffered. Most of the time if tail -f isn't giving you the output you expect, it's because the program writing to the file or stream is block buffered. In other words, it's not writing to the file until the buffer hits a certain size. That size can be rather large. With many programs you can force the program to be line-buffered so that it writes as soon as it hits a newline characters.

