From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Sun, 18 Oct 2009 16:00:36 -0400 Message-ID: From: Akshat Kumar To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: [9fans] fmt(1) standard behaviour Topicbox-Message-UUID: 89cd2e38-ead5-11e9-9d60-3106f5b1d025 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