Next: Output Redirection
Up: The Standard Input and
Previous: The Standard Input and
The Unix operating system makes it very easy for programs to use the
terminal. When a program writes something to your screen, it is using
something called standard output .
Standard output, abbreviated as stdout, is how the program writes
things to a user. The name for what you tell a program is
standard input (stdin). It's possible for a
program to communicate with the user without using standard input or
output, but very rare--all of the commands we have covered so far use
stdin and stdout.
For example, the ls command prints the list of the
directories to standard output, which is normally ``connected'' to
your terminal. An interactive command, such as your shell,
bash , reads your commands from standard input.
It is also possible for a program to write to standard
error , since it is very easy to make standard
output point somewhere besides your terminal. Standard error, stderr,
is almost always connected to a terminal so an actual human will read
the message.
In this section, we're going to examine three ways of fiddling with
the standard input and output: input redirection, output redirection,
and pipes.
Converted on:
Mon Apr 1 08:59:56 EST 1996
|