News for hackers. Stuff that matters.
Re:Sysexits – preferable exit codes for programs by RandomChance on Monday November 01, 2021 @01:02PM (#29069566)
I learned recently that Windows has system error codes for process errors: https://docs.microsoft.com/en-us/windows/win32/debug/system-...

A coworker mentioned that programs should return internal state information using codes < 0, but I have not fact checked that.

Re:Sysexits – preferable exit codes for programs by junon on Monday November 01, 2021 @07:58AM (#29065571)
The typical codes I see used today are:

0 = OK 1 = unexpected error 2 = usage error

And then signal codes, which are either 127 or 128 (I forget which) + the signal code.

Anything beyond that is meaningless since because it's not enforced anywhere it's not reliable to use in scripting less you specifically target that version of the program.

Re:Sysexits – preferable exit codes for programs by dusted on Monday November 01, 2021 @06:31AM (#29064954)
I never knew these existed, I wonder how widespread their use is. But from now on.. I'll use them :)
Re:Sysexits – preferable exit codes for programs by kkirsche on Monday November 01, 2021 @08:12AM (#29065678)
Many but not all are also in Python:

https://docs.python.org/3/library/os.html#os.EX_OK

I put together an enumeration to make it cross platform:

https://gist.github.com/kkirsche/2adb8c94794048ec30736b8fe5f...