9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] fmt(1) standard behaviour
@ 2009-10-18 20:00 Akshat Kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Akshat Kumar @ 2009-10-18 20:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-19 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <<fe41879c0910181300s3e1ba6efueda064db0b8a474@mail.gmail.com>
2009-10-18 21:33 ` [9fans] fmt(1) standard behaviour erik quanstrom
2009-10-18 22:25   ` Rudolf Sykora
2009-10-19 11:43     ` roger peppe
2009-10-18 20:00 Akshat Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).