CONCEPT: Every program you run from the shell opens three files: Standard input, standard output, and standard error. The files provide the primary means of communications between the programs, and exist for as long as the process runs.
The standard input file provides a way to send data to a process. As a default, the standard input is read from the terminal keyboard.
The standard output provides a means for the program to output data. As a default, the standard output goes to the terminal display screen.
The standard error is where the program reports any errors encountered during execution. By default, the standard error goes to the terminal display.
CONCEPT: A program can be told where to look for the standard files, using input/output redirection.
UNIX uses special characters to tell processes where to look for input and output. Using the "less-than" sign with a file name like this:
Using the "greater-than" sign with a file name like this:
Use two "greater-than" signs to append to an existing file. For example:
Redirecting standard error is a bit trickier, depending on the kind of shell you're using (there's more than one flavor of shell program!). In the POSIX sh shell that is issued by default to isuux users at ISU, redirect the standard error with the symbol "2>".
If you have questions about the shell, refer to the manual page for the shell you're using. For the csh shell, type
EXAMPLE: Type the command