Question 120
In a Linux Essentials study lab, the student observes: An operator types echo hello > greetings.txt and later believes the redirection marker was passed to echo as normal text. Which statement most accurately describes the cause?
Explanation
Correct Answer
Output redirection syntax is interpreted by the shell before the invoked command runs. This explains the stated Linux behavior. The corresponding safe action is: Explain that the shell processes the output redirection and writes the command's standard output into greetings.txt. Confirm it with: The named file contains hello and the terminal shows no echoed word for that command.
Incorrect Answers
The offered principle concerns: An interactive Bash history list records previously entered commands for inspection and reuse. That is not what the current scenario establishes. Its controlling mechanism is: Output redirection syntax is interpreted by the shell before the invoked command runs.
Shell variables are not automatically included in a child process environment unless exported. That principle governs the offered alternative, but the facts in this question are explained by: Output redirection syntax is interpreted by the shell before the invoked command runs. The two technical dependencies must be distinguished.
The alternate statement is relevant when shell globbing occurs before command execution and is suppressed by shell quoting. Here the root condition follows: Output redirection syntax is interpreted by the shell before the invoked command runs. It is not the same causal explanation.