Next: 1.3.4 File name expansion Up: 1.3 The UNIX Environment: Previous: 1.3.2 Piping () Contents Index

## 1.3.3 Standard error (stderr)

Most UNIX and GMT programs will on occasion write error messages. These are typically written to a separate data stream called stderr and can be redirected separately from the standard output (which goes to stdout). To send the error messages to the same location as standard output we use

    UNIXprogram > errors.log 2>&1

When we want to save both program output and error messages to separate files we use the following syntax:

    GMTprogram > output.d 2> errors.log

Next: 1.3.4 File name expansion Up: 1.3 The UNIX Environment: Previous: 1.3.2 Piping () Contents Index