Automation, Orchestration, and Scripting
A script sets PREFIX=app and then runs echo $PREFIX_log, expecting app_log. The output is empty. Which change produces app_log?
Show the answer
Correct answerD. echo ${PREFIX}_log
Without braces the shell reads PREFIX_log as the variable name, which is unset. Braces mark where the name ends. Using ${PREFIX_log} is tempting but still references the unset variable PREFIX_log.