Bash can give unexpected results if one edits a script while the script is running. But it would often be very convenient to be able to edit a temporary copy of a script tha
Just adding this solution as an easy and clean way to protect running BASH scripts from being changed:
#! /bin/bash { your_code; exit; }