Standard Error (stderr)
Standard error is another output stream typically used by programs to output error messages or diagnostics. It is a stream independent of standard output and can be redirected separately. The usual destination is the text terminal which started the program to provide the best chance of being seen even if standard output is redirected (so not readily observed). For example, output of a program in a pipeline is redirected to input of the next program, but errors from each program still go directly to the text terminal.
It is acceptable—and normal—for standard output and standard error to be directed to the same destination, such as the text terminal. Messages appear in the same order as the program writes them, unless buffering is involved. (For example, a common situation is when the standard error stream is unbuffered but the standard output stream is line-buffered; in this case, text written to standard error later may appear on the terminal earlier, if the standard output stream's buffer is not yet full.)
The file descriptor for standard error is 2; the POSIX
Most shells allow both standard output and standard error to be redirected to the same file using
&> filenameBourne-style shells allow standard error to be redirected to the same destination that standard output is directed to using
2>&1csh-style shells allow standard error to be redirected to the same destination that standard output is directed to using
>&Read more about this topic: Standard Streams
Famous quotes containing the words standard and/or error:
“An indirect quotation we can usually expect to rate only as better or worse, more or less faithful, and we cannot even hope for a strict standard of more and less; what is involved is evaluation, relative to special purposes, of an essentially dramatic act.”
—Willard Van Orman Quine (b. 1908)
“There exists a black kingdom which the eyes of man avoid because its landscape fails signally to flatter them. This darkness, which he imagines he can dispense with in describing the light, is error with its unknown characteristics.... Error is certaintys constant companion. Error is the corollary of evidence. And anything said about truth may equally well be said about error: the delusion will be no greater.”
—Louis Aragon (18971982)