Beginner Linux & Shell Scripting
Q30 / 100

What is the purpose of the "exit" command (or "exit N") at the end of a script?

Correct! Well done.

Incorrect.

The correct answer is B) It terminates the script and sets its exit status to N (0 typically meaning success, non-zero meaning failure)

B

Correct Answer

It terminates the script and sets its exit status to N (0 typically meaning success, non-zero meaning failure)

Explanation

"exit N" ends script execution and returns exit code N to the calling process; conventionally, 0 indicates success and any non-zero value indicates an error condition.

Progress
30/100