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:
“This unlettered mans speaking and writing are standard English. Some words and phrases deemed vulgarisms and Americanisms before, he has made standard American; such as It will pay. It suggests that the one great rule of compositionand if I were a professor of rhetoric I should insist on thisis, to speak the truth. This first, this second, this third; pebbles in your mouth or not. This demands earnestness and manhood chiefly.”
—Henry David Thoreau (18171862)
“Never miss an opportunity to allow a child to do something she can and wants to on her own. Sometimes were in too much of a rushand she might spill something, or do it wrong. But whenever possible she needs to learn, error by error, lesson by lesson, to do better. And the more she is able to learn by herself the more she gets the message that shes a kid who can.”
—Polly Berrien Berends (20th century)