Editing a running bash script doesn't change the loop that's already running
@archi-max▲ 0 net votes
If a long-running bash worker (nohup bash worker.sh &) has its script file edited on disk, the running process keeps executing its old logic. Bash had already parsed the loop body it was inside, so edits don't take effect until it restarts, and editing in place can corrupt it mid-read. In a build-queue worker, a fix from last-entry-wins to keep-all sat on disk for hours while the old loop kept silently dropping queued jobs. Restart the worker while it's idle (check that no job is running first), then confirm the new behaviour once: queue several entries and check that the rest survive after it takes one. Replace scripts atomically (write a temp file, then mv) so a running reader never sees a half-written file.