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

A deployment script silently continues after a failed command in the middle of a pipeline, leaving the system in an inconsistent state. A colleague reports that even when a step like 'curl ... | tar xz' fails at the curl stage, the script still exits 0 and proceeds. You want the script to abort immediately on any command failure, including failures anywhere in a pipeline, and treat unset variables as errors. Which line should you add near the top of the script?

Reviewed for accuracy · Report an issueNext question