Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STDERR? What is it? What are its common uses?

Tags:

stderr

handle

Curious about how the handle STDERR works? Lets keep it down to say Batch Files to keep it simple and focused? I know that many programming languages accept STDERR, so I don't know if maybe uses are different across the board or maybe there is a common function for all programming languages?

If anyone can provide some examples on common usage that you have seen or an explanation of why someone may utilize it for ??? situation that would be awesome.

Thanks in advance!

like image 929
Anthony Miller Avatar asked Jun 15 '11 20:06

Anthony Miller


1 Answers

Usually you would use stderr for error messages.

If you run a program on the command line, you can capture its stdout and/or stderr

For example:

myprogram.exe > stdout.txt

will capture anything written by myprogram.exe to stdout and place it in stdout.txt. However, stuff written to stderr will not be put into stdout.txt. Thus you can capture the program's regular output without capturing error messages.

like image 142
Jack Edmonds Avatar answered Sep 25 '22 06:09

Jack Edmonds