[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
Re: Bash does not read up the whole script which it is currently executing
Thu, 06 Aug 2009 10:01:45 +0300
Thunderbird 18.104.22.168 (X11/20090608)
On Aug 5, 2:05 pm, Marc Herbert <address@hidden> wrote:
> 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.
Same here, as Marc said.
I think that usually we are reading the script from a file and this is
the use-case we must focus on. Currently, we have the problem I
described when executing a script from a file and I think this must be
John Reiser wrote:
On 08/04/2009 12:48 AM, address@hidden wrote:
It is an intended design feature that the shell reads only as much as
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
to each subprocess that does not have redirection (or closure) specified
for its stdin.
To avoid this feature, then use the "-c" parameter to specify the entire
as a string on the command line:
bash -c "$(< filename)"
Or, make a temporary unique copy of the file, then invoke the shell on