Back to Developer Roadmap

Exit Codes and $?

src/data/roadmaps/shell-bash/content/@hxjqlxolS_ahtro4T0EKG.md

4.0558 B
Original Source

Exit Codes and $?

Exit codes are numerical values returned by a program or script upon completion, signaling whether it executed successfully or encountered an error. The special variable $? in Bash stores the exit code of the most recently executed command. A value of 0 typically indicates success, while any non-zero value signifies failure, with different numbers often representing specific error types.

Visit the following resources to learn more: