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

Re: type versus Copy in DOS



** Reply to message from "Patricia M. Godfrey"
 on Mon, 18 Feb 2008 16:20:30 -0500


>> type test.txt > test2.txt

>> It works.

> Son of a gun! It does... The one caveat is that when type
> worked, it did NOT display the file on the screen.

Caveat? This is fundamental DOS redirection. It probably was
part of Seattle DOS in 1979, before MS transformed SDOS into
MS-DOS! This was the ORIGINAL way to print, BTW -- and still
works! 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 -- in truth, a "device" is ANYthing not on the
motherboard, like a monitor or keyboard or something attached to
a port). 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 (which,
in turn, despatches that output to Kansas). Anyway, of course
the text doesn't display -- you aren't TYPEing to the screen any
more!

Look up two concepts: redirection and piping. Fun-da-ment-al.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------