What are the conventions for stdout/stderr messages?
问题 I have an app that will fprintf both help and error messages to stderr . Should I send messages to stdout if I am exiting with status EXIT_SUCCESS (such as when I issue the --help option to my app)? Likewise, should I keep sending error messages to stderr on EXIT_FAILURE ? Or should I send all help and error messages to stdout ? What are general conventions for this with POSIX-compliant UNIX applications? 回答1: Clearly error messages should go to stderr , because you don't want to capture them