The Birth of Standard Error
spinellis.gr
spinellis.gr
And before reading the article I already had the impression that it came from someone seeing error messages going to an awfully inappropriate place.
http://pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=...
Regarding the OP comment about not being able to tell correspondence between a given output and an error: That is an interesting point, but generally in the Unix command line idiom, one stops the program on the first error, so it is easy to tell. However, if you have process that can't stop (like a server), then one has to be more careful and should probably use a more general logging system.
command 2>&1
Having said that, GP's request is pretty niche, it's only useful when the program uses stdout (not a gui, web etc) and is doing work that might write to stderr while it's writing to stdout (so no summary report generators, long running physics simulations etc)
Then there's the problem with granularity. An output for a long running program could be purely informative, minor warning, major warning, minor error, critical error or some other category. Putting all those outputs on stderr doesn't simplify anything for a script that would still need to parse the output and determine what to do with it.
Someone will come and say this is all well and good for GNU but what if we aren't using GNU? The answer is the same, because at least in this case the GNU conventions are sane and consistently applicable to virtually all command-line programs.
When invalid arguments are passed to a program, of course it should print to stderr, and exit unless it can do something smarter or prefers to ignore the options (most programs wouldn't).
The issue of severities has no bearing on stdout vs. stderr. If you have a syslog-like severity system, all those messages can go to the same stream (probably a file or the network, but it could be stderr).
Before anyone says things should be done another way, please point us to some examples of popular programs that do not abide by the above on a Linux/Unix system. Most do, and all should, and it's not so difficult.
[1] http://www.gnu.org/prep/standards/standards.html#Command_002...