bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: don't just seek to the next line if the script has been edited


From: Pierre Gaston
Subject: Re: don't just seek to the next line if the script has been edited
Date: Fri, 7 Jun 2013 15:46:02 +0300

On Fri, Jun 7, 2013 at 3:34 PM,  <jidanni@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 .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]