8 Matching Annotations
  1. May 2025
    1. There has been an attempt to systematize exit status numbers (see /usr/include/sysexits.h), but this is intended for C and C++ programmers. A similar standard for scripting might be appropriate. The author of this document proposes restricting user-defined exit codes to the range 64 - 113 (in addition to 0, for success), to conform with the C/C++ standard.

      It sounds like he's proposing aligning with the sysexits.h standard?

      But I'm not clear why he refers to "exit codes to the range 64 - 113 (in addition to 0, for success)" as user-defined. To me, these seem the complete opposite: those are reserved for pre-defined, standard exit codes — with 0 for success being the most standard (and least user-defined) of all!

      Why to use exit codes from 1-63 for user-defined errors??

    1. BSD-derived OS's have defined an extensive set of preferred interpretations: Meanings for 15 status codes 64 through 78 are defined in sysexits.h.[15] These historically derive from sendmail and other message transfer agents, but they have since found use in many other programs.[16] It has been deprecated and its use is discouraged.

      [duplicate of https://hyp.is/12j9KjELEfCQc79IbTwQnQ/man.freebsd.org/cgi/man.cgi?query=sysexits&sektion=3 ]

      Why is this deprecated and what should be used instead?? Standardizing this stuff would be good, and this de facto standard seems as good as any!!

  2. Feb 2021