logoalt Hacker News

PaulHoulelast Wednesday at 3:54 PM2 repliesview on HN

Aren't you supposed to return a 0 status code when "yea done!" and some other status code when it wasn't done?


Replies

hiAndrewQuinntoday at 6:16 AM

There is a parallel universe where the convention is that 0 is used for when something went wrong, and 1-127 are reserved for all the myriad and beautiful ways in which things went right.

yosefklast Thursday at 10:54 AM

Indeed you're supposed to, but that way if someone calls exit(0), it looks like the program worked fine, when in fact they committed some debug code and made the program no longer run to completion. "Yay, done" was put in for the scripts to flag this sort of thing, presumably based on experience.

show 4 replies