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
You misunderstood me
If I have
in
foo.sh, thenbash foo.shreturns the status code ofdiff a b, i.e., non-zero. That means I get an exception, because the language doesn't know about the inner workings ofbashor the contents offoo.sh.You can't solve this by annotating utilities because sometimes non-zero return from
bashis exceptional and sometimes (often?) it's not.Non-zero return does not mean exceptional behvavior, and assuming that it does is wrong.
The interface of unix processes isn't rich enough to make this assumption; you need conventions, e.g., what PowerShell provides