On Fri, Jun 7, 2013 at 3:34 PM, <jida...@jidanni.org> wrote: > Let's say you are running a script that is doing > a loop while ... echo Enter name; read name; .. > > During which the script gets edited on the disk by somebody. > > Well shouldn't bash, when it goes back to the disk to read some next > part of the script, first do some sort of check to tell if the script has > changed on disk, instead of the current behavior which apparently is to > seek() to the former byte number and execute the next line which now > very well might be halfway lodged inside some comment or something. >
That has been discussed on help-bash recently http://lists.gnu.org/archive/html/help-bash/2013-05/msg00046.html My opinion is that it's reasonable to have no expectation as to what should happen if you edit a script while it's running. I don't think it's a great idea to slowdown bash to check if, when running from a file, it has changed, or to use non-buffered input .