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: Chet Ramey
Subject: Re: don't just seek to the next line if the script has been edited
Date: Fri, 07 Jun 2013 16:23:56 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5

On 6/7/13 10:19 AM, Greg Wooledge wrote:
> On Fri, Jun 07, 2013 at 10:15:46PM +0800, jidanni@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
> checking and performance penalty to try to avoid users shooting themselves
> in the foot *on Unix*.
> 
> As far as I'm concerned, the correct solution is to educate the users
> instead.  I don't speak for Chet, of course.

The current bash behavior is described in

http://lists.gnu.org/archive/html/help-bash/2013-05/msg00049.html

There are certain obscure cases where this can cause problems on Unix due
to parent/child sharing of file offset pointers.

I think the correct solution is to retain this behavior where it is
required (e.g., when reading a script from the standard input) and to
discard it when reading a script from a file.  This doesn't directly
address the jidanni's concern, but I think the actual occurrence of this
problem is infrequent enough to not do anything more elaborate.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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