EasyManua.ls Logo

Commodore PC 40 - Redirecting Command Input and Output; How to Redirect Your Output

Commodore PC 40
494 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
16 MS-DOS User's Reference
~edirecting
output
'ppending output
You
can
automatically
set
your
path
when
you
start
MS-DOS
by
including
the
path
command
in a file called autoexec. bat. Refer
to
Chapter
4,
"Batch Processing," for
more
information
on
the
autoexec.
bat
file.
Redirecting Command Input and Output
Usually,
MS-DOS
receives
input
from
the
keyboard and sends its
output
to
the
screen. You can, however,
redirect
this flow
of
com-
mand
input
and output. For instance,
you
may
want
input
to
come
from a file instead
of
from
the
keyboard, and
you
may
want
out-
put
from a
command
to· go
to
a file
or
lineprinter
instead
of
to
the
screen. With
redirection
you can also
create
pipes
that
let
the
out-
put
from
one
command
become
the
input
for
another
command.
How to Redirect Your Output
By
default,
most
commands
send
output
to
your
monitor.
If
you
want
to
change this and
send
the
output
to
a file,
you
just use a .
greater-than sign
(>
) in
your
command. For example,
the
follow-
ing
command
displays
on
the screen a
directory
listing
of
the
disk
in
the
default drive:
dir
The
dir
command
tan
send
this
output
to
a file
named
contents
if
you type
the
following:
dir
>
contents
If
the
contents file
doesn't
exist,
MS-DOS
creates
it
and stores
your
directory
listing there.
If
contents
does
exist,
MS-DOS
replaces
what
is in
the
file
with
the
new
data.
If
you.
want
to
append
your
directory
or
add
one
file
to
another
(instead
of
replacing
the
entire
file),
you
can
use
two
greater-than
signs
(>
> )
to
tell
MS-DOS
to
append
the
output
of
the
command
(such
as a
directory
listing)
to
the
end
of
a specified file. For
example,
the
following
command
appends
your
directory
listing
to
an existing file
named
contents:
dir
»
contents
If contents
doesn't
exist,
MS-DOS
creates it.
[
c
c
c

Table of Contents

Related product manuals