CLASS="CHAPTER" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >

Chapter 6. Directing Input/Output

Table of Contents
Concept Definitions
Usage
Command Substitution
Performing more than one command

The directing input/output chapter explains how you can use a program and send its output to a file or to another command that you wish to use. This technique is very powerful and there are a number of ways of doing this.

Concept Definitions

All three of the following definitions are called “ File Streams.” They hold information that is either received from somewhere or sent to somewhere. In a UNIX system, the keyboard input (standard input), information printed to the screen (standard output) and error output (also printed to the screen) are treated as separate File Streams.

Standard output

Standard output is the output from the program printed to the screen, not including error output (see below).

Standard input

Standard input is the input from the user. Normally the keyboard is used as the standard input device in a UNIX system.

Standard error

Standard error is error output from programs. This output is also sent to the screen and will normally be seen mixed in with standard output. The difference between standard output and standard error is that standard error is unbuffered (it appears immediately on the screen) and standard error is only printed when something goes wrong (it will give you details of what went wrong).