Skip to main content
1 of 2

Strangely, zero is not always false.

In particular, the Unix and Posix convention is to define EXIT_SUCCESS as 0 (and EXIT_FAILURE as 1). Actually it is even a standard C convention!

So for Posix shells and exit(2) syscalls, 0 means "successful" which intuitively is more true than false.

In particular, the shell's if wants a process return EXIT_SUCCESS (that is 0) to follow its "then" branch!

I agree, I am nitpicking!