On Linux at least the default buffering for things heading
to the screen is buffered on the return. Which is why my
interactive example involved sending one character at a
time. :-)
UPDATE
It also flushes upon reading from STDIN. These two
features make interactive scripts much more reasonable.