← Quiz: Bash Scripting for DevOps: all 10 questions
Quiz: Bash Scripting for DevOps · Question 9 of 10
The health-check script prints "ALERT" and then runs exit 1. Why does the exit code matter?
The health-check script prints "ALERT" and then runs exit 1. Why does the exit code matter?
- A.It makes the output red
- B.Cron wrappers, CI jobs and monitoring tools decide success or failure from the exit code
- C.Bash refuses to print without it
- D.It deletes the log file
Answer & explanation
Correct answer: Cron wrappers, CI jobs and monitoring tools decide success or failure from the exit code
Machines read the exit code, not the text, so an error must exit non-zero.
Can you get the rest right without peeking?
Take the timed Quiz: Bash Scripting for DevOps quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →