🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6151

Re: Normal MSDOS multitasking!

#6151
From: Scott C. Sadow
Date: Sat, 19 Dec 1992 16:25
64 lines
3264 bytes
In article <DAVIS.92Dec16172346@pacific.mps.ohio-state.edu>, news@pacific.mps.ohio-state.edu writes:
>Hi,
>
>    I'd like to see a tee program which will do something like:
>
>C:\> make | tee > out
>
>The tee programs that I have seen are worthless in this regard because MSDOS
>does not multitask.  So what about:
>
>C:\> tee make out
>
>Here tee runs make sending the output to both stdout and to the file out.  To
>do this, tee would have to hook the appropriate DOS int 21 write string to
>stdout call.  This seems doable but I have not seen it done.
>


Here is the program I use. Syntax is simple. On any command that pipes the
output (stdout) to a file, put "TEE" at the beginning of the line. i.e.
"TEE MAKE > OUT". This is the same as "MAKE > OUT", but whatever "MAKE"
sends to stdout is displayed on the screen. You can also use
"TEE <cmd> | MORE", because "|" really sends stdout to a file. Note: some
programs buffer the output, so you will see a burst of data, perhaps 512
bytes, every so often.

This program works by running "COMMAND.COM /C <arg>". It traps DOS
interrupts 02H (PutChar), 06H (Direct Console I/O) 09H (PrintString) and
40H (WriteFile). If stdout is a file, then TEE uses bios routines to
output the character(s) to the screen, and then calls the normal DOS
routine to complete the call. For WriteFile, TEE sees if the file handle
is stdout.


begin 400 tee.exe
M35K0 0(    @    __\9 $    "W    /@    $ ^S!J<@              
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                      " _ )T%(#\!G0C@/P)="J _$!T1"[_+J4 Z%X 
M=?904[0.NP, BL+-$%M8Z^> ^O]TXNA% '7=Z^7H/@!UUE!35K0.NP, B_**
M!$8\)'0$S1#K]5Y;6.N\@_L!=;?H&@!ULE!345:T#KL# (ORB@1&S1#B^5Y9
M6UCKFE!34K@ 1+L! )PN_QZE /;"@%I;6,,RP+1+S2&P(2[%%J4 M"7-(;1,
MS2$                       "A+  NHZD +HP>K0"X@  NHZL +HP>L0"X
M7  NHZ\ +HP>M0"X;  NH[, B]R#PP_!ZP2,T /8C-@KV+1*S2%RGBZ+-JL 
MB@PR[8/! H $ P/QB_Z#QP/]\Z2P(*JP0ZJP+ZJP(;0US2$NC :G "Z)'J4 
ML"&,RH[:N@  M"7-(2Z.!JD ,_^,P4F.V8L. P#!X02X0T_\)CL%=!(F.P5T
M!D?B^.DX_R: ??\ =?,F@7T"35-UZR:!?010177C)H%]!D,]==N#QPB,PH[:
MB]>,RX[#NZD Z0#_                                            
?                                            
 
end


   Scott C. Sadow
   scott@mycro.UUCP
   ...gatech!nanovx!mycro!scott
Technical Details
Message-ID: <1992Dec19.112545@mycro.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!gatech!wa4mei!nanovx!mycro!scott
References: <DAVIS.92Dec16172346@pacific.mps.ohio-state.edu> <1ghb1vINNccb@ub.d.umn.edu> <9212142475@fcshome.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!gatech!wa4mei!nanovx!mycro!scott
From: scott@mycro.UUCP (Scott C. Sadow)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Normal MSDOS multitasking!
Message-ID: <1992Dec19.112545@mycro.UUCP>
Date: 19 Dec 92 16:25:45 GMT
References: <DAVIS.92Dec16172346@pacific.mps.ohio-state.edu> <1ghb1vINNccb@ub.d.umn.edu> <9212142475@fcshome.UUCP>
Lines: 64