Automation, Orchestration, and Scripting

A startup script must load /etc/app/env.conf with source, but only when that path exists as a regular file. Which line does this correctly?

Show the answer

Correct answerD. [ -f /etc/app/env.conf ] && source /etc/app/env.conf

The -f operator is true only when the path exists and is a regular file. The -n operator tests only whether the string is non-empty, which is always true for a literal path, so source would run even when the file is missing.