bug-bash
[Top][All Lists]
Advanced

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

Re: A note for read builtin


From: Chet Ramey
Subject: Re: A note for read builtin
Date: Tue, 22 Jun 2010 16:50:54 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

On 6/18/10 10:05 AM, Dr. Werner Fink wrote:

> as now is visible the last command in the pipe sequence done
> in the bash is a real sub process whereas in the ksh it is not.
> 
> The question rises: Why does the bash require a sub peocess/shell
> for the final command of a pipe sequence.

It's an implementation decision: the code as it exists today is more
straightforward.  Since Posix requires that all commands in a pipeline
be executed in a subshell environment, though it allows the ksh behavior
as an extension, there's been no requirement to change it.

If anyone would like to take a shot at changing the code to not fork when
executing a command with a pipe for stdin, I'd be glad to take a look at
the result.

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



reply via email to

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