maxdraco

Exit code

The number a program hands back when it finishes: zero for success, anything else for failure.

Concept Programming and AI

When a command-line program finishes, it hands back a small number called its exit code, or exit status. Zero means it succeeded and anything else means some kind of failure, so scripts in a Shell (command line) and automated checks can tell whether a step worked without reading its output. A check that “exits with an error” is using this number to say that something it tested failed.

See also

  • Shell (command line) The program that reads typed commands and runs them; bash and zsh are common ones.
  • AI Artificial intelligence: software that performs tasks usually thought to need human judgement.
  • API A defined way for one program to ask another for data or actions.
  • Endpoint (route) One specific address on a web service that a program can call to do one job.
  • Environment variable A named setting a running program inherits from whatever started it.
  • Git Free software that records every change to a set of files, used to keep the history of most software projects.
  • GraphQL A query language for APIs in which the client asks for exactly the data it wants in one request.
  • Infrastructure as code Managing servers and networks by writing their settings down in files that a tool applies, instead of setting each one up by hand.

Sources

  1. Shell Command Language: Exit Status for Commands (POSIX.1-2024)The Open Group / IEEEofficial healthy, checked 2026-11-15
  2. Exit statusWikipedia healthy, checked 2026-11-15 archived copy