A script named deploy.sh must run only when the preceding build command finishes without error. Which shell operator should you place between the two commands to achieve this?
The && operator runs the right-hand command only if the left-hand command exits with status 0, which signals success. That matches the requirement exactly: deploy.sh runs only when the build succeeded. If the build fails, the shell skips deploy.sh and the overall exit status reflects the failure, which is useful in scripts.
Why this answer
Exit statuses drive shell control flow: zero means success, non-zero means failure. The && operator performs a logical AND on those statuses, executing its right operand only after a successful left operand. Chaining the build command with deploy.sh through && therefore guarantees deployment happens solely on a clean build, which is the standard idiom in shell scripts.
Exam trap
The trap here is treating the semicolon as a conditional separator, when it merely sequences commands and ignores whether the first one succeeded.