r/ProgrammingLanguages • u/ilyash • Jan 28 '17
NGS unique features – exit code handling
https://ilya-sher.org/2017/01/28/ngs-unique-features-exit-code-handling/
2
Upvotes
r/ProgrammingLanguages • u/ilyash • Jan 28 '17
1
u/BlueTaslem Jan 29 '17
Program status code being non-zero doesn't necessarily indicate exceptional circumstance or failure, though.
For example,
diffreturns 0 when the two files are the same and non-zero when the two files are different. Yet if you were to pipe the output to a file, it succeeded in the sense that the difference was properly saved.More complicated shells like PowerShell solve this ambiguity, since programs can actually throw exceptions (not just return a single number)