9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Akshat Kumar <akumar@mail.nanosouffle.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] fmt(1) standard behaviour
Date: Sun, 18 Oct 2009 16:00:36 -0400	[thread overview]
Message-ID: <fe41879c0910181300s3e1ba6efueda064db0b8a474@mail.gmail.com> (raw)

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	other threads:[~2009-10-18 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-18 20:00 Akshat Kumar [this message]
     [not found] <<fe41879c0910181300s3e1ba6efueda064db0b8a474@mail.gmail.com>
2009-10-18 21:33 ` erik quanstrom
2009-10-18 22:25   ` Rudolf Sykora
2009-10-19 11:43     ` roger peppe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe41879c0910181300s3e1ba6efueda064db0b8a474@mail.gmail.com \
    --to=akumar@mail.nanosouffle.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).