Question 590
Before changing a Linux system, an engineer observes: A maintenance script should treat a directory name containing spaces as one command argument. Which check most directly isolates the relevant cause or prerequisite?
Explanation
Correct Answer
Inspect how Bash splits and expands the unquoted variable in the invoked command. This isolates the relevant condition before applying a change. The appropriate corrective response is: Quote the path expansion as "$directory" when passing it to commands.
Incorrect Answers
Check whether the shell variable has been exported and inspect env in a child process. That would matter when a child process cannot see a variable that works when echoed in its parent Bash shell. The relevant distinction in this case is: Inspect how Bash splits and expands the unquoted variable in the invoked command.
Inspect the file permissions and whether the current directory is in the PATH lookup. That would matter when a technician invokes a local executable by name but Bash reports command not found although the file is in the current directory. It does not address this case's requirement: A maintenance script should treat a directory name containing spaces as one command argument.
Inspect echo "$PATH" and type -a for the command to see every candidate in search order. That would matter when an interactive Bash command resolves to the wrong binary because an old admin directory precedes /usr/bin in PATH. That separate mechanism does not verify the needed Linux administration outcome in this case.