Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the "usage" notice get printed to stderr?

When the user executes a program with incorrect arguments, and the program prints a 'usage' instruction to the user, should this be printed to stderr?

like image 958
jsj Avatar asked Dec 18 '13 06:12

jsj


1 Answers

Many programs do it like this, gcc being one popular example. The rationale is that normal output of the program may be piped out to another program, which will get confused by the error message (which is purely intended for human consumption).

like image 169
oakad Avatar answered Sep 30 '22 09:09

oakad