Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: why does "jobs | wc" not work?



On Tue, Nov 26, 2002 at 12:42:22 +0100, Dominik Vogt wrote:
> On Tue, Nov 26, 2002 at 11:09:15AM +0000, Peter Stephenson wrote:
> > In zsh
> > 
> > jobs | anything
> > 
> > causes the shell to fork for the left hand side of the pipeline.
> 
> Um, why must builtin commands run in a subshell?  I would have
> naively thought commands like "echo something | ..." would just
> run in the current shell.  Spawning a subshell sounds a bit
> inefficient.

On the contrary, both commands can run asynchronously. Thus, this is
more efficient, well at least for commands that take time.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA




Messages sorted by: Reverse Date, Date, Thread, Author