Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!wuarchive!mit-eddie!mit-amt!snorkelwacker!spdcc!merk!xylogics!cloud9!jjmhome!m2c!wpi!ear From: ear@wpi.wpi.edu (Eric A Rasmussen) Newsgroups: comp.sys.ibm.pc Subject: Re: Redirection and piping Message-ID: <6250@wpi.wpi.edu> Date: 13 Dec 89 01:58:32 GMT References: <89345.110313MHS108@PSUVM.BITNET> Reply-To: ear@wpi.wpi.edu (Eric A Rasmussen) Organization: Worcester Polytechnic Institute, Worcester ,MA Lines: 38 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? It's relatively simple. > redirects standard output from a program, which would normally go to the screen, to whereever you redirect it to. For example, typing "main > prn" at the dos prompt would cause the output from the program main to go to the printer. You can also redirect output to a file. < redirects standard input to a program, generally from a file, instead of taking the input from the keyboard. For example, typing "main < commands.txt" at the dos prompt would cause the program main to act as if you had typed all the characters in the file commands.txt from the keyboard. | takes the output from a command or program, instead of a file or device, and passes (pipes) it along to a second program for subsequent processing. (Note that I'm not so familiar with this feature, but I know how to use it.) For example, typing "dir | more" at the dos prompt has about the same effect as "dir/p", but in this case you are using the program MORE to display the output from DIR one page at a time by intercepting its output and only letting you see 24 lines of it at a time before making you press a key to continue. When you use the /p option with the DIR command, you are using a built in feature of DIR. (Note that for this to work, you must have the program MORE.whatever-the-extension-on-it-is somewhere in your directory path.) Hope this helps. _ _ +-=-=-=-=-=-=-=-=-+ |_ ,_ . _ |_} _ _ ,_ _ _ _ _ ,_ | ear@wpi.wpi.edu | |_ | | |_ | \ |_\ _> | | | |_| _> _> |_' | | | ear%wpi@wpi.edu | --< A real engineer never reads the instructions first! >-- +-=-=-=-=-=-=-=-=-+