Automation, Orchestration, and Scripting
A backup script must write to the directory in OUTDIR. If OUTDIR is unset or empty, the script should use /tmp/out for that one command, without assigning a value to OUTDIR. Which expansion meets this requirement?
Show the answer
Correct answerA. ${OUTDIR:-/tmp/out}
The :- form substitutes the default when the variable is unset or empty and leaves the variable unchanged. The := form also yields the default but assigns it to OUTDIR, which the requirement rules out.