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

拟墨画扇 提交于 2019-11-30 14:50:36

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.

STDERR stands for Standard Error. It, as the name suggests, primarily used for reporting erroneous behavior. By default, on every system I know of, I points to the terminal just like STDOUT. These entities are represented separately, however, allowing the user to print only normal output to the terminal and redirect errors to a log (just one example).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!