Bird
0
0

A script contains the line echo "Done" > and fails to run. What is the problem?

medium📝 Debug Q7 of 15
Linux CLI - Pipes and Redirection
A script contains the line echo "Done" > and fails to run. What is the problem?
AThe '>' operator is missing a target file for output redirection.
BThe echo command syntax is incorrect without parentheses.
CThe '>' operator should be replaced with '>>' to append.
DThe quotes around "Done" are unnecessary and cause error.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze redirection usage

    The '>' operator requires a filename to redirect output.
  2. Step 2: Identify missing filename

    Command ends with '>' but no file specified, causing failure.
  3. Final Answer:

    The '>' operator is missing a target file for output redirection. -> Option A
  4. Quick Check:

    Output redirection needs filename = D [OK]
Quick Trick: Redirection operators must always have a file target [OK]
Common Mistakes:
  • Leaving out filename after '>'
  • Thinking quotes cause error
  • Confusing append and overwrite

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes