Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!samsung!cg-atla!fredex From: fredex@cg-atla.UUCP (Fred Smith) Newsgroups: comp.sys.ibm.pc Subject: Re: Redirection and piping Message-ID: <8161@cg-atla.UUCP> Date: 12 Dec 89 13:58:50 GMT References: <89345.110313MHS108@PSUVM.BITNET> Reply-To: fredex@cg-atla.UUCP (Fred Smith) Organization: Agfa Compugraphic Division Lines: 37 In article <89345.110313MHS108@PSUVM.BITNET> MHS108@PSUVM.BITNET (Mark Solsman) writes: > > Can any one out there explain how to use the redirection and the pipeline >features with ms-dos? I have tried these damn things since I started using >computers, yet have allways been unsuccessful. I can redirect the output to a >destination, and I can somewhat pipe the output to another program(maybe). My >problem is going the other way. I have a hard disk utility that makes you enter >the drive number from the keyboard. I would like to redirect the drive numbers >from another file, so that I could run that unattended. Any help would be >greatly appreciated! >------- >Mark Solsman Mark: In the general case DOS i/o redirection is used (from the point of view of the keyboard operator) in the same way as in Unix. However, what may be the problem you have encountered here is that in DOS some programs do not use stdin/stdout/stderr, but rather read from or write to the hardware directly, or at least use BIOS services rather than those provided by DOS. It is DOS that does the i/o redirection, so if your hard disk utility reads the keyboard either by using BIOS services or going direct to the keyboard interrupt then you are out of luck. Many DOS programs are quite unfriendly in this manner, in that they assume that theyown the whole machine and can do anything they please. This works fine only in the case where they do not need to interact with other programs (obviously the situation envisioned by the designers of that program). As an aside, let me give you an illustration. I have written a unix-like more program for DOS which reads the keyboard via BIOS services. The reason it does this is that it is possible that more may be displaying data from a pipe or otherwise redirected file, but still needs to be able to get commands fromthe keyboard, even though stdin may be redirected. Fred