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

2013-06-10 Thread Linda Walsh
Mike Frysinger wrote: pretty sure the linux kernel (and others?) would return ETXTBSY and not even allow the write I think that's a relatively new innovation -- i.e. since the ability to setup read-only code segments was implemented, though FWIW, you are right. I think it

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

2013-06-10 Thread Mike Frysinger
On Sunday 09 June 2013 16:59:15 Linda Walsh wrote: > jida...@jidanni.org wrote: > > All I know is there I am in emacs seeing things in the output of a > > running bash script that I want to tweak and get busy tweaking and saving > > changes before the script finishes, thinking that all this stuff w

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

2013-06-09 Thread Linda Walsh
jida...@jidanni.org wrote: All I know is there I am in emacs seeing things in the output of a running bash script that I want to tweak and get busy tweaking and saving changes before the script finishes, thinking that all this stuff will be effective on the next run of it, when lo and behold n

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

2013-06-07 Thread jidanni
> "CR" == Chet Ramey writes: CR> I think the correct solution is to retain this behavior where it is CR> required (e.g., when reading a script from the standard input) and to CR> discard it when reading a script from a file. This doesn't directly CR> address the jidanni's concern, but I think

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

2013-06-07 Thread Chet Ramey
On 6/7/13 10:48 AM, Gerard Seibert wrote: > On Fri, 7 Jun 2013 10:19:44 -0400 > Greg Wooledge articulated: > >> Yes it can. You're talking about adding a ridiculous amount of extra >> checking and performance penalty to try to avoid users shooting >> themselves in the foot *on Unix*. > > The job

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

2013-06-07 Thread Chet Ramey
On 6/7/13 10:19 AM, Greg Wooledge wrote: > On Fri, Jun 07, 2013 at 10:15:46PM +0800, jida...@jidanni.org wrote: >> Well it is going to happen anyway, so maybe bash should check by >> default, and not check if -o risky is set or something. It can't be that >> expensive. > > Yes it can. You're talk

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

2013-06-07 Thread jidanni
> "GW" == Greg Wooledge writes: GW> You're talking about adding a ridiculous amount of extra checking GW> and performance penalty to try to avoid users shooting themselves in GW> the foot *on Unix*. I dunno... I thought it might be just reading a couple bytes from where the date is stored bef

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

2013-06-07 Thread Gerard Seibert
On Fri, 7 Jun 2013 10:19:44 -0400 Greg Wooledge articulated: > Yes it can. You're talking about adding a ridiculous amount of extra > checking and performance penalty to try to avoid users shooting > themselves in the foot *on Unix*. The job of the OS is not to prevent a user from shooting thems

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

2013-06-07 Thread Greg Wooledge
On Fri, Jun 07, 2013 at 10:15:46PM +0800, jida...@jidanni.org wrote: > Well it is going to happen anyway, so maybe bash should check by > default, and not check if -o risky is set or something. It can't be that > expensive. Yes it can. You're talking about adding a ridiculous amount of extra chec

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

2013-06-07 Thread jidanni
> "GW" == Greg Wooledge writes: GW> On Fri, Jun 07, 2013 at 09:09:53PM +0800, jida...@jidanni.org wrote: >> Well OK but sometimes a script could be running for years, during which >> any change to a file will result in bash executing random bytes... GW> This is why you don't edit an installed

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

2013-06-07 Thread Greg Wooledge
On Fri, Jun 07, 2013 at 09:09:53PM +0800, jida...@jidanni.org wrote: > Well OK but sometimes a script could be running for years, during which > any change to a file will result in bash executing random bytes... This is why you don't edit an installed script in-place. Instead, you move it aside,

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

2013-06-07 Thread jidanni
Well OK but sometimes a script could be running for years, during which any change to a file will result in bash executing random bytes... Imagine if you press down on the mouse button meanwhile someone moves the screen up or down... you end up pressing on a different person's face. So I don't se

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

2013-06-07 Thread Pierre Gaston
On Fri, Jun 7, 2013 at 3:34 PM, 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 scrip

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

2013-06-07 Thread jidanni
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