Article View: comp.os.msdos.programmer
Article #7715Re: tee for DOS?
From: Michael Spencer
Date: Sun, 24 Jan 1993 18:55
Date: Sun, 24 Jan 1993 18:55
27 lines
1305 bytes
1305 bytes
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
===========================================================================
Technical Details
Message-ID:
<1juom5INNgak@darkstar.UCSC.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!darkstar.UCSC.EDU!cats.ucsc.edu!spencerReferences:
<1993Jan22.184439.27754@magnus.acs.ohio-state.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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