nerdexam
LPI

010-160 · Question #53

What does the exit status 0 indicate about a process?

The correct answer is A. The process ended without any problems. Exit status 0 is the universal POSIX convention indicating a process completed successfully without errors.

The Power of the Command Line

Question

What does the exit status 0 indicate about a process?

Options

  • AThe process ended without any problems.
  • BThe process was terminated by the user.
  • CThe process could not finish correctly.
  • DThe process waited for an input but got none.
  • EThe process finished in time.

How the community answered

(52 responses)
  • A
    94% (49)
  • D
    4% (2)
  • E
    2% (1)

Why each option

Exit status 0 is the universal POSIX convention indicating a process completed successfully without errors.

AThe process ended without any problems.Correct

In POSIX-compliant systems, a process exits with status 0 to signal successful execution - no errors occurred. The kernel and parent processes (including shell scripts) use this value to determine whether to proceed or handle failure. Any non-zero exit status signals some form of failure or abnormal condition.

BThe process was terminated by the user.

User termination via signals (e.g., SIGTERM or SIGKILL) results in non-zero exit statuses, not 0.

CThe process could not finish correctly.

A process that could not finish correctly returns a non-zero exit code, typically 1 or higher, to signal failure.

DThe process waited for an input but got none.

Timing out or receiving no input would cause a non-zero exit status, not the success code of 0.

EThe process finished in time.

Exit codes do not convey timing information - finishing 'in time' is not a concept represented by exit status values.

Concept tested: POSIX process exit status codes and meaning

Source: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02

Topics

#exit status#process management#error codes#shell scripting

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice