← Back to problems
UNSW COMP2041 · hard

22T2 Q9 — Template expander (subprocess)

Copy stdin to stdout, expanding lines that are exactly:

  • <pathname> → the contents of that file
  • <!command> → the stdout of running that shell command

All other lines are copied unchanged.


Python only. From COMP2041/9044 22T2 Final.