🔥 3-day streak
CompTIA Linux+ (XK0-006)15 / 123
Question 15 of 123

A systems administrator is writing a Bash maintenance script that accepts a single argument ($1) representing an action: 'start', 'stop', or 'restart'. Any other value should print an error and exit with status 1. The administrator wants the cleanest, most readable construct that matches the argument against these fixed string patterns. Which snippet correctly implements this behavior?

Reviewed for accuracy · Report an issueNext question