In Unix-like environments, a process chain usually occurs: the result of one program is used as input for another program. Mixing the results with the diagnosis would confuse the next stage of processing. It will also hide the diagnostics from the potential user watching the terminal, where the processing results transferred to the next program are not displayed.
This is the reason for the separation of results and diagnostics in the stdout and stderr standards. Diagnostics is not limited to errors, but should contain everything that is not the result of processing expected in subsequent programs.
Regarding the urgent issue: dos2unix is ββoften used to convert files in place, but can also be displayed on stdout (when called without a file name, it reads from stdin and displays on stdout). Then stdout can be redirected independently of stderr. Consider cat blados | dos2unix > blaunix cat blados | dos2unix > blaunix . You will still see diagnostics (which may contain error messages!), But the result of the processing will go to blah bis.
It is not so often to print diagnostics at all if successful - probably a small adaptation to DOS users. It would be nice if the processing result contained an informational message; for example, he would break the C file.
Peter A. Schneider
source share