zsh-users
 help / color / mirror / code / Atom feed
* processing of pipelines
@ 1999-08-31 15:41 Sweth Chandramouli
  1999-08-31 22:34 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sweth Chandramouli @ 1999-08-31 15:41 UTC (permalink / raw)
  To: ZSH Users

	i've been part of a recent discussion in the comp.unix.shell
newsgroup about how different shells process pipelines, and thought i 
should ask this group about zsh's behaviour.  some quick tests first 
led me to believe that zsh runs each command in a pipeline
sequentially in the current process; some more research now makes me 
think that this only appeared to be the case because i was testing
using a no-op on one side of the pipe, and zsh somehow checks to see 
if the command on the right side of a pipe is actually reading from
the pipe; if not, it treats the pipe like a semicolon.
	my new hypothesis, then, is that zsh (like ksh) runs all commands
in a pipeline in sub-processes except for the last command, which is
run in the current process, but that when the pipe isn't actually
being used, it splits the pipeline up into smaller lists to be
processed individually.  yes?  no?  something else entirely?

	-- sweth.

-- 
Sweth Chandramouli ; <sweth@gwu.edu>
<a href="http://astaroth.nit.gwu.edu/resume/">Will Work For Food.</a>
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: processing of pipelines
@ 1999-09-01  8:29 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-09-01  8:29 UTC (permalink / raw)
  To: zsh-users


Bart Schaefer wrote:

> ...
>
> Zsh *does* run the last command in a pipeline in the current
> shell when the command *is* a builtin, even if that builtin is a loop,
> which is AFAIK different from any other shell; it means that you can do
> things like
> 
>     some external command | while read line; do export $line; done
> 
> and the current shell's environment will actually be modified.
>
> ...

Only one more comment: once such a pipe is suspended, the shell
builtin/construct at the end is put in a sub-shell (and the
environment of the parent won't change any more, of course).

This has caused some trouble lately... (but you *can* suspend such
pipes and if you don't do that you can use parameters changed there -- 
its an attempt to get the best of both worlds).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-09-01  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-31 15:41 processing of pipelines Sweth Chandramouli
1999-08-31 22:34 ` Bart Schaefer
1999-09-01  8:29 Sven Wischnowsky

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).