performance
easy
Apply
io-redirection
2 points
Question 3. CSCD240-E1-A
Cause executable grader to run with stdout redirected to report.txt. pwd is part of PATH.
Work the drill
Answer on paper or in a terminal before revealing the ideal answer.
Ideal answer
grader > report.txt
Acceptable alternatives: ["./grader > report.txt"]
Misconception bank
Each row below is a plausible wrong answer, the thinking that produces it, and the remedy that corrects the misconception. These are the foundation of the multiple-choice framing and the targeted feedback a student receives after answering.
grader >> report.txt
Misconception. Uses append when overwrite was expected (no indication to preserve prior content).
Remedy. Reinforce: > truncates and creates; >> appends. Pair with CTFd 568/569 questions.
grader | report.txt
Misconception. Confuses pipe with redirection; pipes connect to another command, not a file.
Remedy. Re-draw: | = stdout→stdin of cmd; > = stdout→file. Show the error "bash: report.txt: command not found".
Authority mappings
Hover any chip for the mapping justification; click to open the authority record.
DCWF roles:
IT-451 System Administrator
DCWF tasks:
T0498
KU outcomes:
CD-OSC-O2
KU topics:
CD-BSP-T8i
Course-artifact links
Lectures
- CSCD240-S26-L07. I/O redirection, aliases, source, .bashrc, env
Lab questions
- CSCD240-S26-LAB4: Redirect echo hello to out.txt with > and then with >>. Show difference.
CTF challenges
- 03 I/O & Pipelines: The Overwriter
- 03 I/O & Pipelines: Don't Erase, Just Add