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

Re: question about wait in interactive mode



Radu Duta wrote:
> zsh gets stuck in what looks like a wait deadlock.
> 
> cat <<END |
> a
> b
> c
> END
> (
> for f in `cat`
> do
> /bin/echo $f &
> done
> wait
> )

Yes, I haven't yet looked at the code but I think wait is confused about
what it should be waiting for.  This code:

  print | (echo & wait)

also hangs (it's the simplest version I've found:  the pipeline and
the subshell are both necessary), but this code:

  (print | { echo &; wait } )

doesn't.

(Further discussion should really go onto zsh-workers which is where
the following remark is aimed.)

I have a horrible feeling this may be to do with the hairy list_pipe
code in exec.c.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



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