In fact, the pipe is much older than the PC and appears
in the earliest Unix operating systems (see the history at http://www.linfo.org/pipes.html for
details). The pipe accomplishes what its name implies; it acts as a pipe between small applications.
You connect the applications using the pipe and data flows between the applications using the pipe.
For example, you can temporarily connect the Dir command to the Sort command to create a customized
directory output using a command like this:
Dir /A-D | Sort /+13
The resulting command obtains a listing of the current directory, without the directory entries
and sorts them by the time column. Figure 14.3 shows the results of this command.
Figure 14.3
Combining commands
and utilities
makes the command
prompt extremely
flexible.
Redirection always works with a file or other streaming device. You never use redirection with
another command. The two types of redirection are input and output, with output being the most
commonly used. To output the results of a command such as Dir or Sort to a file, you use a greater
than sign (>) or output redirection pointer. Windows clears the file if it exists and places the command
output in it.
Pages:
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904