Skip to content
Vidar Holen edited this page Nov 27, 2026 · 1 revision

Dash does not wrap negative return/exit values. Use a positive integer.

(or Busybox)

Problematic code:

exit -1

Correct code:

exit 255

Rationale:

Dash and Busybox do not allow negative exit values, and exit -1 will not exit at all. Use a code in the canonical range of 0-255.

Exceptions:

None

Related resources:

  • Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!

Clone this wiki locally