liveBook · Manning

Exit code

Also called return code

An exit code is a numeric status returned by a process when it terminates to indicate the outcome of its execution.

How 2 Manning books explain it

Tiny Python Projects: Learn coding and testing with puzzles and games

An error code is a numeric process exit status indicating that a program terminated because an error occurred.

How it is used
Coordinates command-line error reporting, validation, testing, shell redirection, and pipeline control.
How deep it goes
Explains zero versus nonzero statuses, sys.exit() forms, STDERR routing, validation branches, and status assertions, but not operating-system status internals.
Examples
Demonstrates invalid arguments, missing placeholders, STDERR redirection, explicit sys.exit(1), string-based sys.exit(), and nonzero-status tests.
What you can do after
Apply it via Python's sys.exit() and argparse to report failures, separate diagnostics, stop pipelines, and test error behavior.

Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains exit code →

Kubernetes in Action, Second Edition

An exit code is a numeric result returned by a process when it terminates, conventionally indicating success or failure.

How it is used
Uses process results to evaluate container health and interpret container termination during Kubernetes lifecycle operations.
How deep it goes
Explains zero, non-zero, 128+n, 137, and 143 codes, then applies them to probes, restarts, signals, and logs.
Examples
Demonstrates exit code 0 after graceful termination, code 137 after killing, and command results from an exec liveness probe.
What you can do after
Diagnose/debug with it by inspecting pod status, interpreting termination codes, and retrieving logs from the previous container.

Read how Kubernetes in Action, Second Edition explains exit code →

Also covered in

What to know first

Related concepts

Questions about exit code

What is exit code?

An exit code is a numeric status returned by a process when it terminates to indicate the outcome of its execution.

Which Manning books explain exit code?

Tiny Python Projects: Learn coding and testing with puzzles and games and Kubernetes in Action, Second Edition.

What should I know before learning exit code?

Manning books that teach exit code usually introduce command-line argument first.

What kinds of exit code are there?

Kinds of exit code include last exit code.

What is exit code also called?

Exit code is also called return code.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.