Daily challenges →
🐍 Scripting medium ⚡ 50 XP

What does `trap cleanup EXIT` accomplish in a bash script?

An EXIT trap fires on any script termination — success, a failure under `set -e`, or an explicit exit. That makes it the right place to remove temp files, release locks, and kill background jobs.

🌊 This is a free sample — 1015+ more questions on DevOps Ocean

Sign in free to practice the full question bank with daily challenges, XP, streaks, duels and a global leaderboard.

Practice the full bank — free →