EX200 • Practice Test 15
Free EX200 practice test — 15 questions with explanations. Set 15. No signup required.
You maintain a script that performs a long-running task and must clean up temporary files if the script is interrupted. The script uses:
#!/bin/bash tempfile=$(mktemp) trap "rm -f $tempfile" EXIT
# long tasksleep 100
You notice that if the script receives SIGINT (Ctrl+C), the temporary file is not removed. Investigation shows that the trap on EXIT is not executed on SIGINT. Which modification should be made?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.