home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!darkstar.UCSC.EDU!cats.ucsc.edu!spencer
- From: spencer@cats.ucsc.edu (Michael Spencer)
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: tee for DOS?
- Date: 24 Jan 1993 18:55:01 GMT
- Organization: University of California, Santa Cruz
- Lines: 28
- Message-ID: <1juom5INNgak@darkstar.UCSC.EDU>
- References: <1993Jan22.184439.27754@magnus.acs.ohio-state.edu>
- NNTP-Posting-Host: am.ucsc.edu
-
-
-
- esova@magnus.acs.ohio-state.edu (Edward R Sova) writes:
-
- >Where can I get the Unix tee command for DOS? You can split redirection and
- >piping. like maybe foo | tee > prn >logfile. Well I'm not sure of the
- >syntax, and I don't care right now, but I think you see what I want. Where
- >is it? Thanx
-
- Roll your own. Code goes something like this:
-
- while (! feof(stdin)) {
- fgets (str, 255, stdin);
- fputs (str, stderr); // send to screen
- fputs (str, stdout); // send whereever directed
- }
- fflush (stderr);
- fflush (stdout);
- close (dup(fileno(stdout))); // ensure flushing on stdout
-
-
- --
-
- ===========================================================================
- Michael Spencer | 2640 Borregas
- spencer@cats.ucsc.edu | Aptos, CA 95003
- ===========================================================================
-
-