V
V
Valery Ryaboshapko2015-06-25 01:12:01
Programming
Valery Ryaboshapko, 2015-06-25 01:12:01

Are there standards for exit codes?

Greetings.
Tell me, are there standards that define which exit codes to use for which errors? For example, a separate code for a config parsing error, a separate one for bad arguments, another one for runtime errors (like divide by zero), maybe a separate one for I/O errors. The maximum that could be found is such a document.
And in general, how widespread is the use of these codes more than just such a banality?
myscritp || echo "Exterminate!!!!1"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2015-06-25
@valerium

Completely at the discretion of the developer.
The only standard is 0 = success.
Everything else depends on the purpose of the program.
If you want to make it convenient, you can look at the error codes of the most popular programs that are as similar as possible to what you write. But it's not a standard, but...

L
LittleFatNinja, 2015-06-25
@LittleFatNinja

139 segfault
404 not found
what other codes do you need?

V
Vitaly Pukhov, 2015-06-25
@Neuroware

Standards for codes - 0 - good, everything else is bad.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question