Question 440
A Linux operator claims the following problem is resolved: A program reads input from standard input but the data already exists in a local file. Which result best demonstrates an effective repair?
Explanation
Correct Answer
The program reads precisely the input file bytes and produces the intended result. This tests actual resulting behavior rather than only the presence of a command or configuration. The relevant remediation is: Redirect the file to the program using command < input.txt.
Incorrect Answers
The resulting file contains both normal lines and error messages from the command. That would matter when a script needs to record both standard output and error output in a single file for one command. The relevant distinction in this case is: The program reads precisely the input file bytes and produces the intended result.
The terminal displays each line and the file contains the same captured output. That would matter when an operator needs to view command output on screen and retain the same stream in a file. It does not address this case's requirement: A program reads input from standard input but the data already exists in a local file.
The report contains normal output while diagnostic errors remain visible on stderr. That would matter when a command writes reports to standard output and warnings to standard error but only reports should enter a data file. That separate mechanism does not verify the needed Linux administration outcome in this case.