[comp.unix.questions] "tee" problems

acheng@uiucdcsm.cs.uiuc.edu (11/12/87)

/* ---------- "Re: "tee" problems" ---------- */
In article <436@wrs.UUCP> dg@wrs.UUCP (David Goodenough) writes:
|In article <7663@steinmetz.steinmetz.UUCP> davidsen@crdos1.UUCP (bill davidsen) writes:
|>In article <5883@ihlpa.ATT.COM> rinky@ihlpa.ATT.COM (Renkel) writes:
|>|
|>|I am having a problem with the "tee" command.
|>|Construct a program having a printf statement followed by a read.
|>|Run the program piping it to tee and see if you get the printf output before
|>|responding to the read.  If you do please forward info to me on how you did it.
|>
|>Use fflush(stdout)
|
|No that won't work - the problem is tee itself: it uses getc and putc,
|which buffer i.e. you won't see any output from tee till it's read
|(say) 1K or 2K or ..... whatever size your putc and getc macros buffer

Our 4.3BSD tee does not use "getc" or "putc".  (Can't say what is used
as it *may* be a violation of license.)  But from what it uses (real
obvious), David Goodenough's solution works.