As it stands, if not specified a file, fmt(1) takes input from stdin.
In doing so, it waits for EOF before outputting the formatted
lines. I haven't looked into the code, but I suppose it was left
this way due to simplicity (from basic file handling). However,
I doubt fmt(1) is used interactively enough to further merit
waiting for EOF (^D) when taking input from stdin. But it is a
problem when trying to pipe a program that, i.e., operates on a
file that blocks reads, to fmt(1). Since fmt(1) waits for EOF,
it never actually formats any lines. If, on the other hand, while
formatting on stdin, fmt(1) formatted on a line-by-line basis (per
'\n'), then its use (at least for me) could be greatly widened.

I don't mind implementing this, but perhaps others have different
methods of achieving the same (short of implementing the
behaviour of fmt(1) in each application that operates on files which
block reads), or generally a better "fix" than that suggested above.
Thoughts?


Best,
ak

Reply via email to