🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.It makes the output red
  2. B.Cron wrappers, CI jobs and monitoring tools decide success or failure from the exit code
  3. C.Bash refuses to print without it
  4. 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 →