[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: type versus Copy in DOS



Robert Holmgren wrote:
Caveat? This is fundamental DOS redirection.

Yes, I understand that. My two points were that
1) I had not known that type (like copy) could redirect; I thought (because that's all I'd ever heard/read) that it was just for displaying a file on screen. 2. Harry had said that when he tried to use type to redirect a file to an lpt port, the file displayed on screen. When I did it, it didn't. And it printed, which Harry's attempt didn't. So I was subtly hinting that there was something wrong with whatever Harry was doing: port mismapped, command mistyped, something.
Instead of TYPEing or PRINTing to the screen device
a.k.a. CON[sole] or (loosely) STDOUT, you are TYPEing|PRINTing
to a storage device (a file) (or to any other device, like a
hardware printer

Yes, indeed. I tried today commanding
Type con>test.txt
This is a test.
Ctrl-Z
That, of course, is the way one used to write quick and dirty batch files in the days before multitasking, only I had been taught to us
copy con filename.ext

But type does it too.
Redirection shouldn't be unfamiliar: for example, I
have written dozens of BATch files *for this group* that
redirect the screen output of programs to the NUL device
Sure, sure. It was just the combo of type + redirection that came
as a surprise to me. Other than >nul, which more or less goes
with the screen output I had associated with type.

--
Patricia M. Godfrey
priscamg@xxxxxxxx