bug-bash
[Top][All Lists]
Advanced

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

Re: Bash does not read up the whole script which it is currently executi


From: Marc Herbert
Subject: Re: Bash does not read up the whole script which it is currently executing
Date: Wed, 05 Aug 2009 12:05:44 +0100
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

John Reiser a écrit :
> On 08/04/2009 12:48 AM, famzah@icdsoft.com wrote:
>>      First I would like to say that I'm not sure if this is a bug or a 
>> feature of Bash.
>>      If it is a feature, please let me know how to turn it off; or better 
>> make it disabled by default...
>>      
>>      The problem is that Bash does not read up the whole script which it is 
>> currently executing.
>>      As a result of this, if we update the script file with a newer version 
>> while it is running, this may lead to unpredicted results.
> 
> It is an intended design feature that the shell reads only as much as 
> necessary
> to proceed at the moment.  This is required so that subprocesses can share 
> the same
> stdin as the shell.  Bytes for input to the shell alternate with bytes for 
> input
> to each subprocess that does not have redirection (or closure) specified for 
> its stdin.

I am not sure I get this... first of all, the script itself is usually
not read from stdin (but from fd 255 in bash).

Now considering the seldom cases where the script is actually read from
stdin, are you saying that: it is a wanted feature that subprocesses can
concurrently slurp and steal the code executed by their parent? Wow,
that sounds really weird and not something I would wish, but rather a
design limitation that I should constantly worry about.

Regards,

Marc








reply via email to

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